Why did my Inquisitor increase the foreign religion?
Solution 1:
Any religious units you make will follow the majority religion of that city. So if you purchased the Inquisitor after that city was converted, then the Inquisitor would be of the foreign religion and would remove your religion when used. So yes, it's meant to be like that.
As for regaining your religion, you could purchase an Inquisitor in another city that is still Taoist. If you do not have any Taoist cities left, I don't know of a way to regain your religion. Sounds like a good time to pivot to another victory type!