Original problem (reported in comment 3 solved).
The loop behavior caused due to a wrong match in the Tampermonkey script. Instead of a match to a specific webpage, the match was global (*).
It seemed natural to me that if there is a refresh loop, no other webpage is involved but I was wrong --- Even though I stayed in the same webpage, the browser only tried to load others.
Now, after I changed the match from https://example.com to https://example.com/xyz the function worked properly.
Thus, refresh loop behavior is most likely due a global match in Greasemonkey/Tampermonkey.