Is the Cables from the dock seated correctly? They might be a bit loose meaning they are only just connecting therefore when you bump it against your palm it rejoins them temporarily.
I’ve had it before but on a 6… the charging port was very temperamental after a chassis replacement and turned out the connected had not been seated properly. they should be quite snug, do not put too much pressure or your damage the connector!