Ahh this old issue. I've come across this many times. Lost Enochian or greased Lightning as a result. Sometimes is because I've targeted myself or another party member, others it's because I've grazed the touchpad and it's "left clicked" the sceen, cancelling my targeting completely.
One I found yesterday when doing Treasue Maps was I kept selecting the chest as the first target until I rotated my camera to remove the chest from the screen.
I'm sure there is a fix, as someone mentioned in the settings to cancel selecting chests but I don't really want to keep adjusting settings every time I want to select a chest to select them and readjust when I'm going to fight to ignore them.