This song has been around for a long time! Demi Lovato, Camilla Cabello, Anne Marie (and 10 others) all sung the song before it got to Zedd and Maren Morris.
For one reason or another, they all had excuses NOT to do it. Demi thought it was too pop sounding, Camila didn't want to compete with 'Havana', Anne-Marie was already working on 'Friends' with Marshmellow.
How different would the song have sounded if they sung it?
I guess it all worked out for the best.