It's normal as the Mac wakes briefly to play the sound and whatever apps are running will be resumed for a split moment before standby engages again. Not really an issue except for a specific situation where you had content playing on full blast, and then when you plug in the cable it unexpectedly hits you for a split second with that volume. Not really something you can avoid except for turning down the volume a bit or simply muting the Mac before closing the lid.