I really hope that the James Webb never encounters a problem like this.
Kepler is one thing, it is $550 million spacecraft and has had enough time to make an immense number of discoveries.
The James Webb Space Telescope will be ~$10 billion. It will be placed at the L2 Lagrange point which is 1.5 million km from Earth and not a good place to have to go to fix something.