The -i switch calls the specified identifier before a debug line is logged. The return value of the identifier is used as the debug line.
The $debug identifier returns the name of debug file or @window.
the $debug identifier has no value at time of the command so returns $null
the -i switch requires you to add an identifier parameter which you didn't do in your command