To break the message down, this means we connected to a node at 172.16.0.149:9307 and the node reported that its canonical "publish" address was 10.40.4.2:9300, but we could not connect to this node at 10.40.4.2:9300.
There could be many explanations for this but the most common one is that you're trying to use a Docker bridge network across hosts: the Docker docs say:
Bridge networks apply to containers running on the same Docker daemon host. For communication among containers running on different Docker daemon hosts, you can either manage routing at the OS level, or you can use an overlay network.
Elasticsearch is perhaps not seeing this configuration? The node mentioned in this message definitely has a publish address of 10.40.4.2:9300 at which it's not accessible. If its publish address were 172.16.0.149:9307 then I think it'd work.