Chosen Solution

My iPhone 8 is not charging when using the standard charger that comes with the device. It does charge if I plug in that charger to an accessory like the HDMI adapter (lighting to HDMI + lightning), or a headphone adapter (lighting to headphones + lightning). When looking in the port, it looks like the 3rd pin from the left (whenthe phone is facing up) might be missing. Would a missing pin do this? Any idea why running the charger through the accessories works, but not using the charger directly?

It is most likely a faulty charge port dock assembly. I would try a replacement which should fix the problem. They are not that expensive and reasonably straight forward to replace. The pin you mentioned is a negative lane and could be causing your problem.