There's no reason why it shouldn't give an error, it's bad syntax. If anything the strangeness would be that using $null there doesn't return an error.