I told you in another post - stealing has nothing to do with the issue.
The problem is with LOS behavior, for some reason if you step into guards cone of view, after that it will always have LOS to the player.
Try removing actions where you add MrSpy sprite as an obstacle for guards. If you want LOS to detect the player, you should not set it as an obstacle!