Network_mode host doesn't work

I removed my original reply to this topic and moved it to its own topic, where I explained my similar issue in more detail: Option network_mode: host in docker compose file not working as expected