Accessing WSL files via 9P works pretty nice, except for when you use JetBrains. Half of its tools interacting with Docker & WSL do not understand how to work with the \\wsl$\ prefix. Some places you have to put \\wsl$$\, but on other places it gets converted to //wsl$/ which then breaks path mapping.
Have you tried running JetBrains IDEs from within WSL so it is "native". I tried this a couple of years ago and WSLg had some issues which may be fixed by now, e.g. the find and replace popup would not appear.
Edit: there is also JetBrains Gateway as a solution now but I find it less of a seamless experience than vscode remote, e.g. it requires using the large r 4 CPU / 32GB VM option via GitHub Codespaces and it doesn't sync plugins.
Path mapping on PhpStorm was very tricky for me as well (I’m running Docker containers inside my VMs so I had to set up correct mapping in PhpStorm if I wanted to run tests from the IDE) and I’m only talking about regular file paths here (no \\wsl$\ prefixes)…