Although I'm no expert, when I worked in Big Pharma, there were specific time periods that product could be left 'inbetween' stages for before it was cosnidered to no longer be suitable for the next stage. Now although this wasn't always due to exposure to air or because of complete degredation, it is still an indication of how much of a concern it is that substances can degrade either when mixed, or unmixed, and when compressed into a tablet, before and after being coated.
I can't remember the exact durations but, between wet/dry granulation and compression, and between compression and coating, or between granulation and capsulation, there were at least 7 days before the product at that stage would have to be subjected to testing again to determine if it was still ok to go to the next stage. Some products were as much as month. Now although they weren't stored in complete open air the containers weren't only just big enough to fit the product in, they ahd a lot of space, it still does show that there is a lot of time before something degrades just to a point of not being sticky enough anymore to make a pill, let alone the potency degrading too.
Also once the product was manufactured but not yet packed. They had one month to pack it into the blisters or pots or whatever. If that month expired, the product was just tested by QC again to see if it was still ok. This wasn't a regular occurance but did happen enough times and I don't remember many instances where retesting failed.
Some batches were made a year in advance of packing, I think some even two years. They would produce them so far in advance just in case something got in the way (like Brexit, Covid). Again, they would be in containers once compressed but only controlled substances would be kept in special conditions, otherwise it was just a warehouse.
I'm obviously not providing any facts and figures here but it is surprising how long the stuff is held for after making. I kind of wish I learned more about the raw material shelf life but it was outside of the scope of my role and unfortunately my mental health problems I suffered from bullying there have caused me to forget the interesting stuff but remember all the bad stuff.