I can only speak for what was going on in China. But it sounds like there were serious issues with the procurement process in the UK.
For one, none of the masks made here had a "best before" date. The government mandates that certain information must be included on the packaging, including date of production, place of origin, validity period (usually 2 years or 18 months from production date), model name and number, etc. Wherever your masks were sourced from, they clearly had some serious QC issues.
I contacted the NHS and procurement channels in the UK multiple times in June 2020. Same response every time: "We have enough supply of masks, don't need more thanks." Clearly there was a severe shortage on the ground, yet these institutions weren't willing to buy more. Or maybe it was due to political reasons that they didn't want to buy from a Chinese exporter, and preferred to continue struggling with a shortage instead?
I agree that the first few batches of masks were abysmal. In my factory we struggled to get the manufacturing right for the first few weeks but after experience with supplying the domestic market, the quality gradually became better for export. By April 2020 there weren't any more major defects (e.g. ear loops coming off, metal strip falling out).