Middleware with limited licenses is also a problem the developer chose. If there was a legal requirement to publish the code (source code escrow should be required for copyright to be enforceable IMO) then developers would take care not to fall into that trap.
The company can’t just give up functional source code if it’s built on top of some licensed tech.