Pretty easy. Build off six starship constructors, then have each one queue up a light starship. You'll be building 6 even if you fleet cap at 5. It's a little more painful when you've got 3 of those and they're all competing for 2 spire starship builds.
Ohhh, I got it. Sorry, misunderstood. It's not a bug that "potential" ships in other queues do not count against the ship cap for the purposes of determining whether a given dock can start a ship. Once there's actually a full cap "in service" the other docks will skip over that type, but iirc they don't lose the progress on it (I could be wrong on that; that would be more painful if it lost that).
AFAIK, the behavior in these circumstance where a queued item becomes ineligible to build due to whatever is:
If there is something else eligible to build in the queue, refund all resources spent so far on the now ineligible ship, and move to the next eligible item. (or possibly, transfer some of the already spent resources to the new ship's progress, refunding any leftovers)
If there is no other eligible item in the queue, and progress has not started on that item, then stop constructing, stop consuming resources, engineers stop assisting it for construction, until it becomes eligible (say, the ship count fell below ship-cap), at which case it should resume normal construction on that ship.
If there is no other eligible item in the queue, and progress has been started on that item, then continue finishing the item, but don't actually "emit" it.
If another ship in the queue becomes eligible while building the ineligible item, refund all resources spent so for on the current ineligible ship, and move on to the next eligible item. (or possibly, transfer some of the already spent resources to the new ship's progress, refunding any leftovers)
When the current ineligible item is done, don't actually emit it, stop constructing, stop consuming resources, engineers stop assisting it for construction, and wait until it becomes eligible to build. If it does become eligible to build, then since all the resources and time were already put into it, it should "release" the item with no extra resources or time.
If another ship type in the queue becomes eligible before the current complete yet ineligible item becomes eligible, then refund all resources spent so far on the ineligible ship, and move to the next eligible item. (or possibly, transfer some of the already spent resources to the new ship's progress, refunding any leftovers)
In no case should resources be spent or engineers be trying to assist construction when no progress can be made on the current item. Also in no case (resource caps aside) are resources wasted.