When calling debugpy from command line using the vscode integrated terminal, it does not quote command line arguments. I saw some similar issues (#767) but these were focused on launching the debugger ...
Python 3.9 will go end-of-life next week so Python 3.6 is far behind in the rearview mirror. If is impossible to upgrade your build platform then it is known to be insecure.