When an enemy ship lands to bring reinforcements, but the ship has no NPC:s in it, and its entrance remains closed, the issue is that the mission "Capture a pirate ship", QuestId 2C0FD9, is stuck in the Running state. The issue is not the mission that gets stuck because of that. You should use the console command
sqv 2C0FD9
to see the status of that mission. If it's in the Running state, you should use the command
resetquest 2C0FD9
to reset that mission. After this it should be in the Stopped state. But this reset takes effect only the next time a pirate ship lands. So you must go somewhere else, and be in your own ship, when you use that command.
I wrote more specific instructions already earlier in
this post.
I got this same issue a couple months ago when I was doing the mission Groundpounder. The final battle was in a deadlock because a pirate ship landed to bring reinforcements, and all the friendly NPC:s were waiting for the battle to continue, but nothing happened because the ship that landed was unmanned. I had seen many unmanned pirate ship already long before that, but I had ignored them. But at that point I had to investigate it more because of the stuck side quest mission.
This has since then happened to me several times again, and at least twice in a place named "Abandoned hangar", from which the below two pictures are:
View attachment 383630
View attachment 383631
I am not aware of a way to make NPC:s spawn in that ship at that point.
The issue in which you land at a random location, and a pirate ship lands near you but it's unmanned, is the same issue as the above.
View attachment 383632
I am suspecting that this mission gets stuck most likely when a Starborn Guardian IV ship lands near me, but I still need to verify that. But I know that if I am able to board a landed Starborn ship, and the ship is unmanned, this mission is bugged and I need to reset it.