This is true for both melee ships and starships on enemy planets, and was originally by design. These ships are using what I call "planetary roamer" mode (an internal AI-only flag), which far predates Free Roaming Defender mode. This was a decision made way back in alpha, and I'm all right with revisiting it, but a big part of me still really likes that these ships do not guard individual posts, but rather entire planets. Brings a bit of a different feel to the melee units.