Type stability bug in compiler?

A MWE means other people have to be able to run the code example showing the issue. See Please read: make it easier to help you if you haven’t already.