Yeah, this is a frustrating bug that has been around for ages.
---------------
Dear Egosoft,
I realised yesterday that when we are red to a faction and approach one of their stations, the HUD updates with pings around each new "I" and docking point that comes into range.
Its visually like these mission pings that break our target lock BUT in the case of the station, our lock on hostile ships is not broken. Not sure if it saying that helps or not - it just occurred to me that it looks like you have something similar working on the off chance that it was something new to try with this mission lock bug.