The shortage certainly isn't Brexit, but part of it is COVID. When COVID struck and car sales fell, some of the chip manufacturers decided to close down some plants completely and when sales rose after quite a short period, they did not have the capacity to eet demand.
Building new capapcity where ever you build it is not the work of a minute. Sites must be chosen, planning agreements reached, building time may well be a year or several, then there is all the high tech plant, there may well be lags in supply and staff have to be trained off.It may well take 5 years to get new plant from concept to production.