I can reproduce your situation.
AFAIK, NextJS is a tech based on ReactJS. So in this answer I will talk about how to debug a common React App. Debug pure React App in VS2022 is a new feature, and it requires you to install the Node.js development workload in Visual Studio Installer:

This will make sure your VS2022 be able to debug or run the React App(I notice you still trying to using command to run the react app, after install this, you will be able to run/debug the React App directly in VS2022).
After import your React App, right click your React App and select Debug->Start New Instance:

(About how to import and configure React App in VS2022, see here)
Another thing you need to notice is, the default port of React App is 3000, that means if you don't do any changes, all of the react App will start on port 3000. This will make your VS2022 unable to debug the React App in this situation:
For example, if you have a React App instance already started on port 3000 or even any other app started on port 3000, VS2022 will not run any code in your Visual Studio React App, no Break Point will hit, it will directly navigate to 'http://localhost:3000/'.
So make sure you have install the Node.js development workload, make sure the port of your Visual Studio React App was not been occupied.
I am able to debug the React App via VS2022 on my side:

For more information, please refer to this official document:
https://learn.microsoft.com/en-us/visualstudio/javascript/debug-nodejs?view=vs-2022