It looks like WordPress is treating your /login page as an API endpoint rather than a regular page.
WordPress has a built-in REST API, and /login might be conflicting with an existing endpoint
To test, try accessing another non-existent page (e.g, mysite.com/randompage). If it gives a standard 404 page, then /login might be reserved.
Rename the page to something like /user-login and see if that works.