The primary reference is Psalm 73.
This song contains many allusions to Job’s cries during the three cycles of his speeches with his three friends. They are found in passages such as, Job 6-7, 9-10, 12-14, 16-17,19,21, 23-24, and 26-31.
When st.5 refers to the new song and the changed vision, we find references in Genesis 50:15-21, Job 42, and John 9:1-12.
When he wrote this song, Ken Medema was reflecting the confused cry of the Psalmist in Psalm 73. Yet notice how the Psalm (and song) is not totally a cry of confusion, but also moves toward an expression of faith, “For God has changed my vision...” (stanza 5). When Heidelberg Catechism, Lord’s Day 10, Question and Answer 28 reflects on God’s providence, it provides the same changed vision and in a beautiful testimony claims we can not only be “thankful when things go well” but can also be “patient when things go against us” and “we can have good confidence in our faithful God and Father that nothing in creation will separate us from his love.”