It is difficult to see from logs what exactly goes on, but here are some principles which may help you to understand the problem
1. MultiChain nodes have database of peers identified by IP:port (not by host name), so once DNS resolution is made, IP is used. If node was connected to specific IP:port once, the peer is stored in the database. In your log example, X.X.X.X:7447 is stored in the peer database
2. MultiChain tries to connect to different peers in random order, until it has several connections. Peers it was connected recently have high priority, peers it was not able to connect many times have low priority.
3. MultiChain always tries to connect to addresses specified in "-connect" and to seed address (multichaind ${CHAIN_NAME}@${MASTERNODE_HOSTNAME}:${MASTERNODE_PORT} in your case)
4. MultiChain disconnects from the seed address when nodes are in sync AND there is at least one other connection (last rows in the log). So, the last two rows are perfectly normal, but getpeerinfo should return results at this moment.
So, there are several directions you can check:
1. Some nodes (or seed) are busy (or have enough connections to other nodes) and doesn't respond or even drop connections
2. Nodes are restarted with different IPs - as a result "peer" database is full of IPs which no longer exist or don't respond on specific port.
3. X.X.X.X is IP of the load balancer and when node tries to connect to X.X.X.X:7447, load balancer doesn't reroute request properly