I think someone (but I forget who) told me that cable connections to my phone's USB-C jack were loose and not connecting well because there was lint etc. in the jack. I didn't believe it at the time, but it turns out they were right. So thanks, whoever it was.