As far as I'm aware there's nothing in the OS that should do that, at least by default. Perhaps an accessibility option. Or your charger is finnicky and somehow disconnects during charging a few times, but you say the sound is different. If you record it, and post it on reddit, they might be able to identify it.