Fight mid game fanatic purifiers is frustrating

So for a century or so I was isolated away from my galaxy's fanatic purifiers who managed to take a quarter or so of the galaxy in that time. Eventually they gobbled up the system with my local worm hole and stared conquering unclaimed territory on my border. After pushing them back and talking ten years to build/tech up my forces I was finally able to go out and purify the pureifiers.

Only to be defeated by....conquering their planets. The pure economic chaos bringing those planets into my empire caused eventually forced me out of the war so I could vassalize the territory having only conquered a little less than a half of it.

NOT how I expected that to go, and it was very frustrating. Guess I'll need to spend 10 years maxing out my resources before I take them on again.