Ok, so update:
The file is now working if i use this syntax:
Just removing the extra curly bracket at the end, the file now works locally, and on the test server.
However, virtually identical files with the extra curly bracket will also work.
It also does not explain why the same file was working locally but not on the test server