False effect
False effect (non causa pro causa—treating a non-cause as the cause) can appear when you say "this should have stopped that, it didn't, so this doesn't work." But there might be another explanation: wrong timing, wrong dose, a different cause for the outcome, or the intervention working only for some. One failure or exception doesn't by itself prove the cause doesn't work. You need to consider alternative explanations before concluding the cause is ineffective.
Examples
The vaccine should stop you getting ill. She had the vaccine and still got ill. So the vaccine doesn't work.
Seatbelts should prevent serious injury. He wore one and still got hurt. So seatbelts don't work.
The treatment should lower blood pressure. His didn't go down. So the treatment is useless.
The policy should reduce crime. Crime went up this year. So the policy failed.
The lock should keep the bike safe. It was stolen. So the lock doesn't work.