I created a minimal project with an attempt to reproduce the problem with either DocumentDB or MongoDB Atlas: GitHub - ArtunSubasi/documentdb-cluster-tester: A sample app which attempts to reproduce a connection problem
It seems to work fine with DocumentDB. The problem may exist within our Cloud Foundry infrastructure.