Hi Guys,
I've been searching for info like yours and i've found more posts related to this question: Connect/disconnect rapidly iPhone or iPad with macbook pro retina 15" mid 2015
In my case when i plug my iPhone on the left side usb port, with iPhone / iPad for example at a minimum % of 30 (more or less) it start switching between the 2 state Connect and disconnect.
So when it start doing this (also with the charger connected or not, and with the other usb device connected or not) i disconnect the iPhone/ipad and i switch to the right port then i return to the left port and it works fine.
i only use original cable, one time happened that i was using the original iPhone cord and, i've changed usb cord to charge my iPad from the left port and there wasn't no problem. (Apple told me that iPhone and iPad cables are different !?!?)
I've called Apple, i've done the diagnostic test and all test that you can make, and all was ok for them, so they were thinking it was a hardware failure but, once i brought the mac to the apple reseller point, they didn't find any issue ... all was perfect... also trying to charge iPad iPhone or other.
I don't know what the problem is... i only know that i've bought this mac like 2 weeks ago and i've a machine that doesn't work properly (hardware talking).
I have the same problem with a logitech mouse the M570 (the same that they sell on they web site) if i connect the usb receiver on the left port the range of the receiver decrease and it only works in a range like 20 cm... if connect it on the right port it works like for 6 mt
I hope they fix this bug and if you have any new just write down
Why for you it is a software problem? In my opinion they will call a campaign for this problem, in future.