Re: how to help in the meantime, I have no advice on anything you could give her. I can't imagine anything that would be able to calm it would be ok to give to a child so young without medical supervision. As mentioned above, reassurance doesn't really work for OCD (if it is that - obviously it may not be) because it continues the compulsion cycle. It might seem to help for a while but often you end up needing it more and more. At the same time I would not take away emotional support from your young and distressed child. Whatever way you deal with it should be under the guidance of a professional so I'm caveating the next bit that I would only do this if she is receptive and seems to enjoy it.
I wonder if you could try some basic version of mindfulness? You could speak about the 'bad thoughts' or 'worries' she gets and how our brain tries to keep us safe by thinking of things that could go wrong but sometimes our brain does it too much and it can make us feel really frightened or sad.
When she is having the thoughts, you could encourage her to say out loud that she's starting to have the bad thoughts again. Not ruminating on the content of the thoughts, but noticing the thoughts have arrived.
She can imagine the thought is a cloud passing overhead or a train going past as she stands at the station (obviously I don't know how much she can engage with this at her age but I think she could get the basic idea with some modelling). Anything externally passing by while she can stay still and observe it passively is fine.
You can be with her as she notices the thought is there. "I'm having the thoughts that I've been bad" and you could look at these thoughts that her brain has come up with not with judgement but curiosity. You're not trying to make them go away - just noticing they're there and watching them pass by.
So instead of "you've not been bad at all! You've not done anything wrong" it can be "oh you're thinking maybe you've been bad? That's interesting that your brain is giving you those thoughts. Let's imagine it's the train going past. My train is red. You can imagine your I've been bad thought is sitting on the train. Or maybe it's the driver. Maybe it's wearing a driver's hat.
I wonder if maybe your brain is trying to protect you from that horrible feeling you get (guilt, if she can identify that) when you've done something wrong and you feel really sorry for it? It's not a nice feeling is it? You think so too? Maybe that's what your brain is trying to protect you from. Thank you brain for trying to protect me but I don't need this thought. Hey let's sit for a minute and watch the trains go past and we can tell each other what thoughts we see go past."
it's fine if her thought comes back again. You can watch it again. "Huh he really doesn't want to give up hey?. There he is. I see him driving his train."
I'm not a professional by the way. I just found mindfulness one of the few things that can sometimes temporarily help and stop an intrusive thought really taking hold if I can do it quickly enough before I've gone too deep in. She should be telling you as soon as she notices it and ideally try to be really casual and relaxed about it. If it makes her worse or more distressed then obviously stop and hopefully it won't be long until you have a professional advising.