If you become a victim of a force majeur event, you are unfortunately at the mercy of the airline. Airlines can cancel, terminate, divert, postpone, or delay any flight without notice in these situations. The airline's only obligation is to refund the price of your ticket, depending on its individual policy and agreements with other carriers. Many airlines will try to accommodate you the best they can, but Rule 240 does not require them to do so in the case of a force majeur . If you think only United Airlines encounters pilot shortages, I have a bridge in Brooklyn that I'll sell you.
Airlines are reluctant to train too many pilots because training is so expensive.
However, given the current customer fallout in response to pilot shortages, it might be cheaper for them to so do in the long run. It is best not to fly the last week of the month. If an airline does not have enough pilots to cover all the necessary flights, the schedule at the end of the month will be especially sparse. This can also carry over into the very beginning of the month. In addition, when an airline is retiring an aircraft from the fleet there can be some scheduling problems, which can also result in a lack of available pilots.