Interesting, Doing a little more experimentation with it, it also happens when you fire directly into an adjacent wall (which isn't something that you'd typically want to do)
But even *more* interesting, is that magic dart, IMB, *but not searing ray* all appear to target your own square when firing point-blank into a wall or corner, although none of those actually hit you.
Additionally they all also target you (and dazzling spray actually hits you) if you fire *one offset* from a point blank wall, in a way that wouldn't bounce off and hit you (Even if it was a bouncing ray)
So aiming at X:
will still target you.