I recently had a problem where my iPhone SE would not charge. This was the first charge after upgrading to 12.1.4, which may or may not be relevant. To cut a long story short, I found that I could get it to charge by first unlocking the phone, then inserting the charger and turning it on. Unlocking after the charger was inserted didn't work.
Subsequently, it began behaving normally again.
I have had an extensive twitter DM session with Apple Support including running diagnostics (which is another story, but I'll ignore that here). They got me to check the charger port for dust (there was some in the outer part but none visible internally).
@srichards had also hinted at the possibility that changes to prevent access to/from accessories while locked may have had something to do with this. Apple Support got me to check Settings > Touch ID and Passcode to see if USB accessories was enabled; it was not, and they recommended I enable it.
Internet searches indicate this problem can occur for other phones including the iPhone XS...