iPhone accessory error won't go away

My phone just started saying that it wasn't meant to work with an accessory and asked if I want to put in airplane mode. Also, the sound comes and goes.

I've tried a turn off / on, reset (home+lock), restore with backup, restore as new phone and nothing seems to work. It won't even charge really, although I got it to start charging with my mophie though.

Looks like a trip to the Apple store?
Took it to the Apple store, they didn't know so they gave me a replacement phone.

Original thread: https://forums.imore.com/threads/iphone-accessory-error-wont-go-away.185421/