WordPress REST API response is empty in browser and script, but not in Postman

The answer for me was setting the X-WP-Nonce with the wpApiSettings.nonce in the headers.