When "For admin-approved users, limit API access to only allowlisted connected apps" setting is enabled, accessing Developer Console may show an error "This session is not valid for use with the REST API".
To replicate this error:
For the purpose of the "For admin-approved users, limit API access to only allowlisted connected apps" setting, this behavior is considered working as designed. The Developer Console is built on top of the REST API; The REST API lies in the API types blocked by this exact setting.
One workaround is to enable Profile Permission "Use Any API Client" and assign the profile to the appropriate users.
Note: doing so will also allow usage of all the Apps.
In the long term, Developer Console is in maintenance-only status and Salesforce is not making changes other than serious security issue fixes, hence this behavior is not going to change.
Salesforce recommends switching to modern developer tools, such as Salesforce CLI, VS Code and Salesforce Code Builder whenever possible.
004637119

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.