Oracle has always had a huge presence in government. Large companies too, but Federal use has really helped keep them afloat as open source and competing products that are far cheaper have eaten their lunch.
For Musk the case is even more extreme. Tesla's early growth was bankrolled by EV credits and carbon offsets, which were state programs, and SpaceX is a result of both Federal funding and direct R&D transfer from NASA to SpaceX. The latter was mostly uncompensated. NASA just handed over decades of publicly funded R&D.
These two would probably be rich without the state, but would they be this rich?
The same was true back in the original Gilded Age. The "robber barons" were built by railroad and other infrastructure subsidies.
However I do agree that private wealth beyond a certain point begins to pose a risk to democracy and the rule of law. It's a major weakness in libertarian schemes that call for a "separation of economy and state." That's a much, much harder wall to maintain than separation of church and state. Enough money can buy politicians and elections.
The main problem with your thought process is that your conflating “wealth accumulation” with “wealth creation”!