She must have lied when she was leaving the UK. At the UK airport she should have declared she was carrying the drug. She needed to prove the drug was prescribed to her and show a letter from the prescribing physician. The letter must include:
Your name
What countries you’re going to and when
A list of your medicine, including how much you have, doses and the strength
The signature of the person who prescribed your drugs
This information is from the government website and it highlights this -
You could get a fine or go to prison if you travel with medicine that’s illegal in another country - check with the embassy of the country you’re going to before you travel.
She knew what she was doing. She just didn't expect to get caught, nor did she realise the seriousness of any repercussions.