Why are two breakers connected across a third breaker?
This is a quadplex breaker. Basically, in order to squeeze more stuff into breaker panels, many manufacturers came up with a way to squeeze two breakers into one space. The problem is that for 240V loads that doesn't work - you end up with 0V between the pair of breakers instead of 240V! So then they came up with quadplex - 4 breakers in 2 spaces. The inner 2 and the outer 2 are each 240V pairs, just like traditional double breakers.
I am not a breaker expert, but that looks to me like it may be &quot;handle tie&quot; rather than a true functional double breaker. Actually, the &quot;All poles have no common trip&quot; reinforces that the breakers are independent of each other, electrically speaking.
That is OK for some situations (MWBC), but if I am correct then that was never actually correct for a 240V circuit such as an oven. That being said, it doesn't matter if you are changing things anyway.
There are two possibilities here for your current (yes, pun intended) situation. You may be able to swap individual breakers, or you may have to deal with them as a set of 4 (quadplex). If they are individuals then you can pick one of the two 40A breakers and replace it with a 20A breaker. Based on the latest picture, the circuit is using neutral, so you can swap either breaker and leave the white neutral as-is. If the new gas range is hardwired, then you should be all set. If it has a plug and you are installing a 20A receptacle, you will likely need to pigtail the 8 AWG wires to 10 or 12 AWG wire to connect to the receptacle, as many can't handle 8 AWG wire.
Make sure the breakers are correct for the panel. There are a lot of similar breakers from different brands. The wrong ones might fit but won't fit correctly.
Also, in case it wasn't clear already, you can't replace a quadplex with two pairs of duplex breakers if even one of the pairs still needs 240V.