I think the foundry problem is more about price and lead time.
In a nut shell TSMC (as one example) will sell you the capacity you wanted if you will pay for the premium for the priority and bump out the cheapskates. At the beginning of COVID lock down all the car companies with JIT manufacturing just cancel the contracts, and TSMC sold them to other companies to build, say, wifi router chips, laptop chips, GPU chips (crypto mining), data center chips, tablet chips, video game console chips, etc. It is their fault for changing their minds.
Tesla will be fine for paying more to bump out their competitors in fab capacity, as their car is expensive and they can lose more for not delivering an EV that cost $50k vs Ford not delivering a $14k Fiesta or Mitsubishi not delivering a $10k Mirage. They can probably afford to bump out a few $150 CPU from AMD or $300 GPU from nVidia.