When reopening $stderr in "a" (append) mode, the file is not written to. However, when reopening with "w" (write) mode, things work as expected.
Also, since I have the server error log set to debug, reopening $stderr also results in other messages being written. For example, info messages.