Apologies for these thoughts being more disjointed than usual. I'm on a call with Citrix that makes me think they're the enemy more than Russia could ever be. So it's mainly a bevy of points that have popped up in my head than any cohesive missive.
I think the issue is this - if Ukraine were a rich country, BAE would happily build the factories to enable them to sell more exports. But that's not the case. Ukraine is mostly dependent on the largesse of Europe and the United States to donate these shells. In which case, BAE has no interest in it without firm orders from the government. Which means the government has to extrapolate what the maximum possible need is going to be.
Remember that the conflict is chewing through millions of shells. No European country has more than their bare minimum reserve available any more. These supplies need (or so the respective governments believe) to be topped up to counter an aggressive Russia should Ukraine fall entirely. On top of how many shells will need to be gifted to Ukraine; because the conflict as it stands looks like it can easily grind out for another year or more. That's a lot of shells. It was claimed earlier in the year that Europe could produce a million a year, but the real number appears to be half that.
Artillery shells are not microprocessors. The required investment is large, but not in the billions or anything (the contract is in billions, but over 15 years and that's for the final product). Mostly it will take time. Even if you could somehow build the factory faster, the human side still needs to be trained up. I'm not quite so concerned about Europe walking into war just because of artillery shell production - they're one of the largest consumables by number after fuel and bullets, but they're not something capable of winning wars on their own. You might start to worry if Rheinmetall re-opens another line for Leopards, or France tells Dassault to get moving on a new tranche of Rafale. Even then, they're not preparing for war without a rather large increase in servicepeople. The training of which, as noted many times in this conflict, takes upwards of a year to do properly. There's no sign of this happening.