If your business model depends on you being able to take money from people who want to exchange it for stuff, why the FUCK would you not have every single possible person trained to be able to take their money?
Because it's not their job, just like it's not my job to stack the shelves, or make the pizzas or bake the bread or tidy the clothes or sweep the floors or collect the trolleys or man the security desk or pack the home shopping orders or deliver the click and collect parcels or make the tea in the cafe or count the money or order the stock and so on and so forth. Supermarkets have many roles beyond "checkout colleague" and not every colleague is comfortable working a till and if they're a shop floor colleague then they have no obligation to take on extra training just on the off-chance there's nobody else available.
Some colleagues aren't allowed to use the tills for H&S reasons - one of the shop floor colleagues in my store isn't till trained as she has a medical condition that means she can't sit for long periods of time (queue busters may need to be on the checkout for anything up to an hour which is too long for her to sit) but the tills are not at the right height for her to be able to stand comfortably at one for more than a few minutes either; another colleague of mine works on the deli counter - he can't go on the checkouts any more because he had a sports injury to his shoulder that affects what he can lift and checkout staff are required to be able to lift things like crates of beer, packs of water bottles, heavy bags of cat litter etc ...
They may just have started/be new to the store - if they aren't a checkout operator then training for their actual role will be given priority to make sure they know what is involved in their main job. Once they have completed that settling in/training period, if they choose to, they can ask to be till trained so that they can help out when necessary.
Some shop floor staff may be under 18 and so aren't allowed to use the tills - theoretically they can but in my company they'd need a supervisor to override and authorise any age restricted product which would defeat the point of having them there to help reduce the queues.
And some staff are till trained but aren't allowed to go on a till even if it is busy because they are required to do another role that supersedes the importance of working the till - eg a checkout supervisor needs to be free to go to any checkout that needs them to override something or check a price or get a game/console etc. So if there's only one supervisor on shift then they can't go on a till, but rather than get into the whole explanation of why they can work the till but can't open a new one they go with the statement that can't be argued with that they aren't trained.
Pharmacies otoh. What do They get up to back there that takes so long?
Their job of weighing/counting/measuring out prescription drugs, confirming quantities and dosages, consulting the medical information, double checking the information, confirming no risk of drug interactions, and generally making sure they aren't making a mistake that could kill someone because they misread a dosage/quantity or gave a prescription to the wrong person.
I had to thank a pharmacist from saving me from a potentially lethal mistake a doctor had made once - I take a medication for a chronic condition and a doctor prescribed me a different medication for an illness I had. Fortunately the pharmacist remembered I was on this other medication (from filling my prescriptions for the last few years) as the drug I had been prescribed for my illness would have had a very bad drug interaction with my existing one and could have resulted in lethal side effects. As soon as he saw my prescription he had alarm bells ringing in his head and so he spent the time looking up the two drugs and checking their status to see the issue instead of just filling the prescription and potentially killing me.