Yes. The Consumer Rights Act (CRA) 2015 and Sale of Goods Act (SGA) 1979 both cover UK NHS prescriptions. The transaction between you and the pharmacy is a "consumer contract" covered by CRA 2015 s 61(1).
I quote from Janet O'Sullivan, O'Sullivan & Hilliard's Law of Contract (2020 9 ed), p 207. The 2022 10 ed shall be published in July 2022.
8.27 According to s 61 of the CRA, a ‘consumer contract’ is defined in s 61(1) as a ‘contract between a trader and a consumer’. In turn, ‘trader’ and ‘consumer’ are defined in s 2 of the CRA as follows:
(2) ‘Trader’ means a person acting for purposes relating to that person’s trade, business, craft or profession, whether acting personally or through another person acting in the trader’s name or on the trader’s behalf.
(3) ‘Consumer’ means an individual acting for purposes that are wholly or mainly outside that individual’s trade, business, craft or profession.
(4) A trader claiming that an individual was not acting for purposes wholly or mainly outside the individual’s trade, business, craft or profession must prove it.
A prescription though, ISN'T a contract. A prescription is merely an authorisation — it authorizes a person, the pharmacy, to supply the medicine without committing an offence. See Part 12 of The Human Medicines Regulations 2012.
So the question will be what the terms of the sales contract are. Obviously, you tender a prescription to a pharmacy, for the purpose of being dispensed medications as
(pre)scribed in your prescription — rightly or wrongly by your doctor. Thus one contractual term is the dispensation of the medications as specified in that prescription.
If the medications are dispensed correctly, then this dispensation would not breach the terms including those in the CRA 2015. Obviously if the medications are dispensed wrongly (eg providing the wrong dosage or the wrong format), then obviously you are entitled to the replacement prescription.
The issues here are suitability of the medication format, and medical negligence. The issue is whether the doctor who prescribed this medicine was negligent (e.g. prescribing a tablet form, when a patient can’t ingest tablets). If so, then you would claim damages from the prescribing doctor that would be the cost of acquiring the correct medicine, including the cost of the replacement prescription and compensation for an injury from the wrong medicine.