Hot Plugging HDMI cables is never a great idea when your devices are powered on it can cause electrical damage to the HDMI ports and often means your devices are not fully clearing EDID from past connections.
PC - does it have an HDMI Output rather than DisplayPort?
If yes I would power off all devices and connect the PC HDMI to the Soundbar and the Soundbar eARC to the TV eARC and do not connect any other devices.
If you have to use DisplayPort then go through the same process so that you only have PC > Soundbar > TV connected.
Now power on the TV, wait until it has fully powered on then power on the Soundbar, wait then power on the PC.
Does that work as required?
Joe
PS Your PC expects an always connected Display, you may have to consider an HDFury Dr HDMI 4K or 8K on the Output side of the PC to keep its settings alive and configured as you want them.
Fix HDMI, HDCP, EDID, HDR and eARC problems. The HDFury range of conversion products sorts many HDMI connectivity and signal format issues.
tmfsolutions.co.uk