This is expected, as it depends on the context.
The raw content will show up for the edit
but not the view
or embed
context.
It’s filtered through the WP_REST_Controller::filter_response_by_context()
method.
You can always add a new field to the response with register_rest_field()
where the get_callback
callback receives an input array with post data, including the raw content.
But then you should watch out to not leak out e.g. password protected posts or content hidden with shortcodes.