it does not cause any trouble or problems just disconnecting and reconnecting peripherals on a Mac ,
but it can cause trouble in windows ,i can sing a song from that when i used to have windows some years ago , disconnecting was never a issue , but the reconnecting sometimes did cause windows to forget drivers and needed reinstalling especially printer and external optical drives ,
never such problems with OSX or Linux, but headphones are meant to be connected and disconnected all the time so should not cause anything on any computer