This was painted in 1881, before the Madame X scandal. Sargent painted it in part to get Pozzi to get his lover (Madame X) to pose for the portrait!
For the record, Sarah Bernhardt (another lover, but really a long-term mistress) called him “Dr. God” and “Dr. Love.” Talk about ego stroking.