Is this a valid Apple request to download software?
It looks legit, but was probably shown to you by mistake, triggered by the rapid connecting and disconnecting. If you are concerned, you could run MalwareBytes Mac to make sure you have no malware. But that message looks legit to me, unless it's a perfect replica of the real message it is emulating.