Zephaniah 3:14-15 “Rejoice…YHWH has taken away the judgments against you…The King of Israel, YHWH, is in your midst; you shall never again fear evil.”
The Greek word in this image is the word translated “Rejoice!” in Zephaniah 3. It’s significant because this same word–as well as “king of Israel/Jews” –is used both in Zephaniah and also in John 19:3 (where the soldiers use it to mean “hail”).
I think John wants us to hear echoes of Zephaniah (and Zechariah 9:9) in these soldiers’ words. They were mocking Jesus, but in God’s sovereignty He put in their mouths a call to the people of God to rejoice that their judgment-removing, enemy-overthrowing, righteousness-bringing King had come.