Why would an iPhone say u201cthis accessory may not be supportedu201d with an Apple brand USB cord that came with it?

This accessory may not be supported nothing plugged in

Check that the port where you plug in the cable on your phone didnu2019t get filled with lint, preventing a good contact.

Take a toothpick and wrap a tiny bit of cotton around it and try to clean the port and the contacts inside.

,Of course, assuming nothing is damaged or wiggly or anything.