God's will is carried out in the way that accords with His pleasure, not as nature in its foolishness, dictates. Sage is he who resigns to God's will whatever it is.
God ordered the plant to grow and be shade for Jonah's head in order to "deliver him from his misery", and it carried out this compassionate order. God commissioned the sun to beat on Jonah's head so that he grew faint and desired death, and it did as the Lord ordered. It is not kinder to Jonah than God. There must be a benefit behind the sun's beating otherwise God would have not ordered it to happen. And it was so.