I'd mirror your parameters via splatting EXACTLY the same as the params that work. The double quotes aren't being used in the method that's working. Also, since you're closing the Generation param in quotes, you're typecasting that to a string. In your method that works, you're passing an integer. Along the same lines, when you enclose 1GB in double quotes, that makes it a string while 1GB without quotes is an integer. I haven't seen this be a problem because of Powershell's weak typing but the New-VM cmdlet may be needing a specific datatype.
$params = @{
Name = $name;
MemoryStartupBytes = 1GB;
Generation = 2;
Path = "C:\Lab\VM";
SwitchName = $SwitchName;
}