“The parameter is incorrect.r” when running takeown to take ownership of my data drive after re-installing Windows

When executing the following command:

takeown /F D: /A /R /D Y

I get the following error:

The parameter is incorrect.r): "D:$Recycle.BinS-1-5-21-1597830813-2420638671-2875775154-1001.

This occurs whether the command is executed through an elevated command prompt, or psexec started through an elevated command prompt. The command used to execute psexec in the elevated command prompt is:

psexec -i -s cmd.exe

Commands used are from the first answer and its comments on this question:

How would I use Takeown to take ownership of all folders on one drive?