EDIT: I've been able to connect to the Windows UE5 instance from WSL2, changing TTL to 2 in the plugin and extension settings. Even so, when I try to run a script file, the UE5 output log displays:
LogPython: Error: Traceback (most recent call last):
LogPython: Error: File "<string>", line 1, in <module>
LogPython: Error: OSError: [Errno 22] Invalid argument: '/home/richardnm/.vscode-server/extensions/nilssoderman.ue-python-1.1.0/python/execute/vscode_execute_entry.py'
It seems that it has the root for file execution on Windows, trying to access the WSL Ubuntu /home/...
directory.