The game config allows you to limit the mass or block count of a ship. This however also affects static entities like stations and planets.
The option should be split into ship limit, station limit and planet limit. I think the check also accounts for docked mass so the main entity is a sum of all it docks + itself. There should also be an option to disable that: <IncludeDockedEntity>false</IncludeDockedEntity> in the limit sections.