Error when restoring database from disk using a variable
Try removing the 'GO' statement.

Referencing the documentation for SQL Server Utilities Statements - GO


  The scope of local (user-defined) variables is limited to a batch, and
  cannot be referenced after a GO command.