Most sets output analog at a fixed and very high volume level. Why? To avoid noise from outside sources.

Optical being immune from this doesn't have to do this so the volume is set by the receiver or sound bar.

I too see no attempt to normalize the two sources. So when you switch my bet is one or the other won't match in amplitude.