Endpoint returns both public IP and private IP

I have a sharded Mongo cluster that returns both the private IP and public IP.

When I try to ping/nc the endpoint from inside the container running my application, I get the public IP. But when my application tries to connect to Mongo it resolves to the private IP.

I have VPC peering between my VPC and Mongo Atlas VPC.

What could be causing this issue?