This incident has been reported on github:
In the process of the conversation on github I realised that the OS version I was using when I encountered this issue is no longer supported.
The oldest macOS version supported is 10.5 Catalina.
So, while the solution I described in the post above seems to be a useful workaround, the preferred / supported way to resolve the issue is to upgrade the OS.