Clearly, switch("d", a = 1, b = 2) does not have a default value, a value matching "d", or any reason to return anything. The documentation
switch("d", a = 1, b = 2)