This is actually an issue on Doorkeeper. To have a custom JSON response for 401 Unauthorized errors instead of a blank page, in ApplicationController
I added:
def doorkeeper_unauthorized_render_options
{json: '{"status": "failure", "message":"401 Unauthorized"}'}
end