Unity throws error because of missing ":" in switch case but Visual Studio Code doesn't

Im programming a little prototype of a card game and am currently working on the function that subtracts resources based on parameters. Visual Studio Code is not giving me any errors regarding my switch case but Unity is and i have no idea why. Im using Unity 2020.3.19f1 Personal

Do I just need to not use the “or” or is this a bug in Unity?

Pattern matching enhancements is a C# 9 feature which is not supported in Unity 2020.3.

You either need to upgrade to Unity 2021.2 or simply not use the or pattern, which can easily be replaced as follow:

case "Money":
case "money":
    do something
    break;

or

str = str.ToLower().Replace(' ', '_');
switch(str)
{
     case "money": ...
     case "prisoner": ...
     ...
     case "broken_relic": ...
}