If someone is facing the same problem, you will have to make sure that the React Native app is not running in background, and what you can do is just restart your desktop to get it working, if not even after closing the app on the local server.
To close the running service
ctrl + c
To reset the dir
npm run reset-project
And even if all of this does not work, just create a new React Native app!