user, games allow you to experience things in many different ways, they're different from movies in many, many ways but especially because of this.
If you just restart and get a "great" score you're going to experience the level the exact same way every time. If you go off and actually adventure, you will see and experience things that the ones that railroad themselves to one single movement path with the same weapon at the same time intervals etc. do not see and experience.
Sometimes, i even go into games doing things that will likely make me lose deliberately, so that i can learn new and interesting things, and i use them to my own advantage, in multiplayer as well.
If you look at things from the perspective of the whole, you should realize. Rather than saying "oh i restarted so it's a different/new/the REAL timeline this time", and instead you see yourself as if someone was sitting next to you and you're playing games together, wouldn't restarting 22 times at the end of the level be seen as more losing than running into an unfortunately strong enemy at a bad time, but still beating them and completing the level?
If you're just playing it the same way over and over again you might as well watch a movie.
OCD can meta itself and prevent you from escaping it almost consciously, because it uses your mind to fuck yourself, so just realize that unless you magically out-meta it and cure yourself, giving into it is, essentially, in almost every case, losing. Pick up the game, play it, and focus on some random bullshit, like how satisfying it is to blow enemies up, or how nice the skybox is, or how your current sub-optimal driving style might very well become a new technique, or maybe your character is just retarded at rallying and you're witnessing their gitting gud firsthand. Make a story or something, autism is fucking powerful so if you're going to use it, use it for your own fun. Make it your bitch, your plaything, not the other way around.
I do think this thread is at least semi-vidya related because some games feed OCD almost as if it was a conscious design decision.
Also what said, play some games that don't have those stupid railroading ideals put in by devs. Dark Souls is unironically good in this regard, too. You might die a few times but there is no counter so it stops nagging you very soon.