5 is quite young to have to take a lot of responsibility and be so different to everyone else. I understand staff in school can't physically help, but could they at least remind her to go to toilet maybe hourly, and make her go and get changed at breaktimes. So that wet or dry, clean or dirty, she gets a clean pad twice a day at school as well as when she gets home. It might seem like a waste initially, but if it gets her in the habit of changing at school, and it becomes routine to her (and those around her), it will be more likely that if she feels a need to change at other times, she will be more comfortable going and changing (and certainly won't be wet/dirty for hours in the interim).
Yes you were wrong to shout, but you know that. Reassure DD that you know that - and that even grown ups get things wrong and have bad days. Maybe, in the context of the pg, you could talk about pads you have to wear and how important it is for you to change them (ok - not all the time wearing, but probably at times you've needed them and you definitely will in 3 months time). And that you will ALWAYS LOVE HER!!! No matter what.
And also reassure DD that you want to help her not have these problems. That's why you're getting her to wear the pads, and going to Drs to see what is causing it and how to help it.
But also talk a bit about how everyone is different to others, but different people have different types of differences. So DD might have problems with the toilet, others have problems learning to read or do sums (betcha she'll see someone in the class with those problems), or maybe others who can't eat chocolate or drink milk or eat nuts cos it might make them sick. Even talk about different coloured hair and eyes, taller or shorter, etc (physical things she can see) and how our insides can be different too.
Sorry, not meant to be epic, but while not having the exact same thing, a girl on our street has similar problems and we have different SN problems to face as well.