Lily, the one who is given the presents, is going to marry Marshall - another member of the series' clique of friends - a few days later. And what Robin thought was going to be a "hen night out" type-of bachelorette party turned out to be family business with all Lily's female greater family members invited. All of a sudden the so appropriate gift Robin had in place for Lily turned out to be less than appropriate in that context. To save herself from embarassement in a childish act of impulse Robin exchanged the gift cards attached to her own present with that of another incidentally exactly same-looking box which turned out to be Lily's grandmother's present for soon-to-be wife Lily.
What we don't see in the scene i have shared is the scene preceeding which was settled in an adult (/sex) shop in which Robin was buying her gift for Lily that was... and here is where the
mention of the black "penis" comes in... a big black vibrating dildo!
Now watch the boring, unfunny scene again with that info in mind. And if you take a sip of a dr!nk while watching, tell me you won't have gushed or spilled your dr!nk - and i won't believe you.