There are three main issues with your script.
First and foremost, %PATH% is already a system variable, and it tells Windows where important things are located on your system. Please do not change its value unless you know what you're doing.
Second, variable names in batch are allowed to have spaces in them, so you've actually created a variable called %PATH % and given it the value C:\Users\XXX\Downloads\CmdLine; (note the leading space).
Third, for /D only iterates over folders if the set contains a wildcard.
If you correct the three issues, your code will look like this:
@echo off set "parent_dir=%USERPROFILE%\Downloads\CmdLine" for /d %%D in (%parent_dir%\*) do ( echo %%~nxD echo. )
Other optional changes are putting quotes around the set statement to prevent hidden trailing spaces and using %USERPROFILE% instead of C:\Users\xxxx to make the script more portable.