I have tried fighting this a couple of times but lost every time. Do you know a solution to make my Android phone keep the connection to a wifi without internet connection?
If you could return valid internal DNS entries for these domains, and serve up a 204 to the right requests, you should be able to stay online.
You need to ensure you don't do it for every possible domain - I believe Chrome also tests random non-existent domains too, to ensure it gets back the expected error.
What is not working fine though, is that I cannot access the internet through the mobile network at the same time. But this seems to really depend on the phone: it works on iPhones and on my previous Android phone, but not on a Pixel 5. I would like to download updates for the esp32 firmware through the mobile network, but this prevents it.