I found the problem. I noticed that the ip port number for the controller in my config is wrong. I had 8433, whereas it should have been 8443. It's right there in the screenshot in my prior post.
At first I thought I had just mistyped it, then I noticed that if I select controller type UDM or unifi controller, and then 'set parameters', the wrong port number (8433) is filled into the config.
If I manually enter 8443, the error messages magically disappear and all is well in the world.