Yes, if you give something attack order it will stay even if unit is not in vision range/became cloaked. It is used frequently to target lock transport in 1v1 for example, or you can give assist order to early bomber with your scout and it will follow it though fog of war.
Its not bug, just game engine thing that is just there and you have to live with it.