Rest API with custom Domain returns 404, but graphql and /admin works

Update:

The problem is with the endpoints that I have created locally and uploaded manually.
Newly created endpoints work.

I need to migrate the database from local to live so that the endpoints work.