So this is either a very old bug or a variation of a (partially fixed) old bug. For example, I found this on the forums from 2019:
Whatever was patched since release in relation to this problem, it is hard to say. But in the current version you can get MM activated within 10 tiles of dead enemies, even enemies that were killed on the same turn. The problem is this: first you have to clear the area around a sniper of proximate enemies (correct so far…), and then a friendly character has to move in order for MM to activate on the sniper or snipers (…the part that is still bugged). I ran a test and this difference is not merely cosmetic, i.e. MM is working but the game doesn’t say so. This is not the case. The weapon becomes significantly more accurate after a friendly character moves. Most the time it doesn’t dramatically effect gameplay as long you are aware of the issue and are taking steps to work around it. But I’m sure if you put your mind to it you could come up with situations where this would forcibly produce sub-optimal play. For example, your only other remaining move is a soldier pinned down by overwatch which you need the sniper shot for to disable the arm and clearing the overwatch, a shot which would could potentially be 30% more accurate if it worked correctly. So it is clear that in its code the game does some type of assessment whenever a character moves and so solution here to have it also run the same assessment whenever a unit dies.
Here is a documented example from a haven defense mission:
No MM and I target a nearby enemy for comparison.
I move an assault (not pictured), using up the rest of his AP. No shots are taken, no enemies are killed, and no special abilities are used. After moving the assault, MM appears on the sniper.
And finally you can see the reticle is noticeably smaller by comparing the 2nd and 4th images.