Edit: I googled it. Here's the first paragraph of the first link from DDG:
> The James Webb Space Telescope (JWST) is expected to cost NASA $9.7 billion over 24 years. Of that amount, $8.8 billion was spent on spacecraft development between 2003 and 2021; $861 million is planned to support five years of operations. Adjusted for inflation to 2020 dollars, the lifetime cost to NASA will be approximately $10.8 billion.
So "spacecraft development" comprised about 90% of the total budget. Of the remainder, 96% is allocated to "five years of operations". So we have about $39 million left over, which I assume covers the launch and everything around it. If you want to try optimizing that, go ahead, but it is nearly a rounding error (0.4% of budget) in the grand scheme of things.
There is an argument to be made that a few million dollars saved is valuable. I would propose a counterargument, that the amount of friction induced by working with private contractors (especially contentious and manipulative ones like those who run SpaceX) would add to some of the development costs, so the savings may not be as big as you think from a naive comparison.