If I understand the issue correctly it sounds like you’re getting content and that content has filters applied that you don’t want correct? Specifically wpautop.
I guess so that I can better understand what it is that you are trying to do, why don’t you want the wpautop filter applied? If you really don’t want the filter my two first guesses are you can get the content pre being filtered with the REST API context “edit” and content.raw. However, not sure that’s what you want either.
The other option would be to just remove that filter in the one instance where you are calling it. I’m not sure exactly what conditional check would work here, but that would be the second approach.
Without seeing the code or understanding what you’re trying to do specifically, I’m just kind of guessing here. Sorry if I’m still not understanding the issue..
Let me know!