I have no idea what help is available in Scotland, but I would imagine the school or your GP would be able to put you in touch with a child psychologist, if this is affecting her so much.
Do you know what has triggered this?
For what it's worth, my friend has had a similar phobia for years: it started as a kid and has ruled her life ever since. She actually bought a house as close as possible to work because she can't bear to use the toilets at her job; she also has to plan shopping trips very carefully and never goes on holiday either, as a result of her phobia. Her DH and kids to on holiday together and she stays at home....!
It's awful, but she's too embarrassed to seek help for some reason. She wishes someone had sorted it out when she was younger...
I had this for a while as a kid: it was because my older brother (6.5 years older) had been watching a horror movie where monsters came out of the toilet. It only came to light because I held my wee in so much I got a kidney and bladder infection (after many embarrassing and spectacular public 'accidents'). Do you think she might have seen something scary? No idea about Scotland help BTW; mine went away when my mum explained nothing bad would come out of the loo, no creatures or monsters etc... but this sounds like it might be more of a full-fledged phobia?
I remember being scared to go to the loo when I was little after the door jammed once and my mum and I got stuck. I was convinced I would get trapped again but eventually the phobia disappeared as I grew up.
Maybe if you could gently get to the root of her fear that could give you a clue where to start.
I don't know about pastoral care in Scottish schools but I'm sure they would do their best to support you and your DD.