Thank you for the explanation. I think I understand now.
You are running the code in two contexts.
When you are running from CLI, your VSC is connected to code-server. This means the debugger is in the server part, so no mapping is required. In fact, no mapping should be present.
The second context is when the code is served by Apache. In this case, you need a mapping. Otherwise, paths in VS Code and on the server don't fit.
I think you should have two separate launch profiles, one for each context, and launch the one you are interested in at the moment. Otherwise, the debugger just won't know what to do.