Thanks for your bug report. Unfortunately I have not been able to reproduce this issue here. I tested your script using the following timer:
alias test timer -m 1000 1 query test
And it ran through to completion with no errors every time I ran it.
When the /background command reports this error, this means that either the file does not exist or is inaccessible for some reason. Is your system low on memory or disk space? These are often the cause of these types of issues. Are you using anti-virus software? These can often make newly created files inaccessible during a scan. Are you saving to a network drive? That might be the cause of the issue. You will need to find a way to narrow down the cause of the issue.