WORKED - iPhone USB disconnecting from MACBOOK Repetetively
Restart the usbd process
A solution to the issue of iPhone rapidly disconnecting from a Mac that has worked for many is stopping the usbd process.
To do that, open the Terminal app from Spotlight (Command+ Space) and enter the command sudo killall -STOP -c usbd. This will pause the usbd process. Now, connect the USB cable and check if the iPhone is still charging on and off rapidly.
MacBook Pro 15″, macOS 10.15