Jaz,
This is a bit different than the other pieces of advice, but I think it’s possible you’re suffering from a form of OCD.
People with OCD often experience intrusive thoughts (which become “obsessions”) and cope with these thoughts through rituals (compulsions). Not all people with OCD have visible compulsions—some people have what’s known as “pure-o,” where their compulsions are instead mental. One form of OCD (which I believe is known as rOCD) is characterized by an obsessive worry about whether one is with the wrong romantic partner.
The way you described this thought as “coming out of the blue,” taking over your mental space, and causing you significant emotional distress makes me think it might be an intrusive thought + OCD-like response rather than a heartfelt “falling out of love.” I’ve also suffered from a similar kind of OCD, and your emotional response sounds a lot like my own. OCD can also flare in times of stress, and it sounds like you’ve been through a lot lately.
You can learn more about OCD, and specifically rOCD online (just look it up). Some people find talking to a therapist helpful (specifically Cognitive Behavioral Therapy, or CBT, can help), I think for others, just knowing “this is my brain spiraling, not my love failing” can be enough. There’s also a workbook my therapist recommended called “Talking Back to OCD” that allows the reader to go through CBT on their own.
Hope this helps!