POCD: the OCD theme almost nobody says out loud
Unwanted sexual thoughts about children, in someone horrified by them, are one of the most recognised themes in OCD. The silence around it lets it grow. Here is what it is and what it is not.

A thought or an image arrives involving a child. Your own child, a niece, a child in the street, a child on television. It lasts a second. What follows is nausea, panic, and a question that will not let go: what if this means I am one of them?
You have probably never said this to anyone. People carry this theme for years, convinced that describing it would end their career, their family or their liberty. The silence lets it grow, and saying it plainly is part of the treatment.
It is a recognised theme
What you are describing is one of the most recognised presentations in obsessive compulsive disorder. It has a name, POCD, and it is on the list of common OCD themes for a specific reason: OCD goes after whatever you would find most unbearable to be, never something you are indifferent to, and for a great many people, parents especially, this is at the top of that list.
The horror you feel is the mechanism. The thought stuck to you precisely because it runs against everything you value, and the distress is the measure of the distance between the thought and you.
What it is not
People who genuinely pose a risk to children are not tormented by the possibility. They are not the ones sitting up at two in the morning searching for a test that will prove their innocence, avoiding their own children, or handing over bath time so that they can never be alone with them. The picture you are describing, the avoidance, the checking, the desperate need for reassurance, is the picture of someone whose every instinct runs the other way.
I know that reading this brings relief for a moment and that the relief will not last. The doubt will find a gap: but what if I am the exception? That gap is the whole of the problem. Every answer you have ever found has expired within the hour, and the expiring is what we treat, not the question.
The evidence-gathering
Look at what you have been doing. Avoiding being alone with children. Handing over nappy changes. Declining to babysit, finding reasons to miss the family party. Replaying every memory of yourself around a child, looking for the moment that proves it. Watching your own body for any flicker of sensation and taking it as a verdict. Searching for a test. Asking someone you trust to tell you again that you are not that person.
Each of these buys a few minutes of relief and teaches your brain that the danger was real. This is the OCD cycle, and it is identical in structure to every other theme. The content is what makes it unbearable. The mechanism is what makes it treatable.
The groinal response
One piece of this needs saying early, because it is what convinces people they are guilty. Anxious attention aimed at your own groin reliably produces sensation there, in anybody, about anything. It is a feature of this theme and of sexual orientation OCD, and it is a product of the checking rather than evidence of anything. For a lot of people, the hour spent on this in the first sessions is the most relieving of the whole course.
Will you report me?
Safeguarding responsibilities exist for every therapist, and I am not going to pretend otherwise. What triggers them is actual risk to a child, not a person in distress about thoughts they find repellent. Telling those two apart is a routine part of assessment, and it is part of what you are coming for. Professionals who know this presentation recognise it quickly.
What treatment does
The treatment is CBT with exposure and response prevention, which NICE recommends for OCD, and it works on this theme as well as on any other. We will not try to settle the question of what you are; answering it is the compulsion. We map your cycle, then withdraw the compulsions, gradually and by agreement, and get your life back: holding a friend's baby, doing bath time, going to the school gate, being a parent or an aunt or an uncle without a running commentary.
You can start with the theme in general terms and fill in the detail over several weeks. Sessions run over secure video, so you can do this from a room in your own house with the door shut. Nothing you say will shock me.
If you have carried this in silence, there is more on how I treat POCD, and the first session goes at whatever pace it needs.