But would a corsair be able to extort MCr30 worth of portable wealth from just any population of 400 people? ...
Not unless this was one remarkably rich crowd, no. If I were forced to rule, I'd say whatever the players could score in the way of trade goods, the pirates could grab for free, plus maybe a few thousands to tens of thousands of credits in cash, jewelry, portable tools and equipment depending on how thoroughly they shook down the population. Maybe grab a couple air/rafts, if anyone has one, maybe grab some tractors or other large high-value items depending on what kind of resources they have to bring such to the ship. It's certainly enough to make the effort quite profitable unless the colony had some means of defense, but nowhere near the value of a ship.
...That begs the question. Why build starships on a world that lack adequate defenses in the first place? ...
My point was the defenses were there in the first place. The pirates of old did not confine their depredations to the sea lanes. It was not common for them to raid or extort small port towns, nor for such towns to mount defenses when pirates were about. There's no reason to believe a pirate of the far future, with a streamlined ship or boats or vehicles to make landfall, wouldn't play the same tune. Where frontier people are threatened by wolves, they take action to defend themselves from the wolves. It is reasonable to expect small settlements to mount whatever defenses they can afford when the game says there are pirates overhead. If those defenses are adequate to deter the typical pirate from preying on the locals, they will most likely also be adequate to deter the typical pirate from preying on things floating in near orbit.
...Any world with MCr30 worth of portable wealth is at risk of becoming the target of more than just one 400T corsair. A half dozen of them could band together and still make a profit out of a raid. ...
Now
that is the more credible threat. Given the lucrative nature of the prize, could the interstellar crime community organize sufficiently to take the prize?
That, I would argue, is game-dependent. I've argued elsewhere - and before - that there's absolutely no reason an Imperium can't keep one or two police-cruiser sized ships or even ships of escort size patrolling every Imperial system. In such a setting, piracy survives by corruption and subterfuge: suborning some crewman to commit carefully timed sabotage, tricking or bribing the ship to be out of place at key moments, and so forth. The colony keeps its own defenses primarily because the Imperial track record in preventing piracy is poor enough to result in that "pirate" encounter table result.
Given that base assumption, the seizure of a ship out of the yards is a very bold and daring act. Certainly doable but likely to draw unhealthy levels of Imperial attention, if for no other reason than that the Imperium's own ship on the scene got jumped or proved either criminally corrupt or embarrassingly inept, and some group of investors with pockets deep enough to build and maintain a Class-A starport ship construction yard is furious over your 30 million credit failure and demands to know what you are going to do about it.
That's not to say it can't happen. Modern history has quite a few very bold, very daring, very well organized criminal acts of breathtaking scope: tens of millions of dollars in diamonds stolen while in transit, world-famous paintings spirited out of well-protected museums. However, they are breathtaking precisely because they are difficult and extremely risky, both in the execution and in the long-term business of getting away with it, and therefore very rare. Being rare, they have not put a halt to the targeted acts: folk still ship large quantities of diamonds, and museums still hang world-famous paintings for public display, and most likely those who found a magical way to profit from building ships in some absurdly low-pop system would still do so.
That does depend on the base assumption though. If one does not accept the idea that the Imperium is patrolling systems or acting vigorously to put down large-scale piracy, then it becomes very difficult to explain a class-A starport in a highly vulnerable setting without invoking levels of local defensive arrangements - and levels of production that would pay for such arrangements - that should push the population up quite a bit.
The real question still boils down to why someone would assemble a ship construction facility in a location that lacked both the infrastructure and the level of traffic to warrant such a facility. Even if the facility is entirely robotic - which is a stretch below TL13 and not easy then - there have to be people to supervise and direct the robots, people to manage the acquisition and/or production of materials and machinery used by the shipyard, people to build and maintain those people's homes, people to operate the grocery stores and pharmacies and restaurants those people use, and so forth, and so forth. Even if the world is a "company town", a substantial fraction of the population is dependents, service workers providing essential support services, and dependents of those service workers; at best a third of the population are likely to be directly employed by the company.