I found the problem, you can't use brackets or quotation marks around the parameters.
This works:
SqlCommand sqlCommand = new SqlCommand("RESTORE DATABASE @localDatabaseName " +
"FROM DISK = @emptyDatabasePath " +
"WITH NOUNLOAD, REPLACE", sqlConnection)