2 pole 20amp breaker connected to my 40 amp stove
It is not correct, NEC 210.21(B)(3) specifies a 50 amp receptacle on 40 amp breaker, with minimum #8 AWG wire is the correct configuration for a 40A range. (NEMA does not designate a 40A configuration.)

It is likely the breaker will protect the wire from being damaged, but the breaker will likely trip often and wear out quickly. Typically modern breakers failure mode is to become more sensitive.

I would suspect the house was originally wired for a gas range.