The REST API encountered an error appears when WordPress cannot deliver a valid JSON response from the /wp-json/ endpoint. The issue arises because the server stops execution before the REST controller finishes, or because a plugin or theme interferes with the request.
Typical triggers include firewall rules that block the endpoint, missing rewrite rules, insufficient memory, outdated core files, or conflicting code which deregisters routes. When the request fails, WordPress reports the generic error in Site Health and blocks editor actions.