Accessing plugin functionality within WP REST API

I have figured out the problem, after trying a load of things I wanted to double check plugins weren’t being loaded at all within the REST API.

I added some rudimentary debugging to the plugin in question and I saw that the plugin was indeed being loaded, my issue was that in these conditions the plugin itself wasn’t exposing functionality it would do under a normal request.

The do_action I wanted to achieve therefore was failing, as it hadn’t been registered. I simply invoked the class that registered the action and now my code works as desired.