Bhagavad Gita, Chapter 5, Verse 10
He who does actions forsaking attachment, resigning them to Brahman, is not tainted by sin, as the lotus-leaf is not tainted by water.
Staying engaged with the world without absorbing its residue, that's the real image here.
The lotus leaf image works because it's not about avoiding water entirely, the leaf sits right in it. Real detachment looks the same way, fully present in life, just not soaked through by everything that touches it.