I just walked past a Prison Guard who was in deep sleep from a while ago. Out of the shadows came another Prison Guard, so I cast Sunray on him and then threw a spear by double-tapping the quickslot, assuming it would target the one I had just targeted with a spell, but I instead turned around and threw it at the sleeping one.

This is very counterintuitive. Casting a targetted spell at any enemy should make them my current target for other spells, wands, and throwables.

I have the same issue with Guiding Light.