But when they came to Jesus and found that he was already dead, they did not break his legs.

Even though man had determined to break the legs of all being crucified, God did not want His Son’s legs broken or the Passover Lamb type would not hold because He would not be “without defect” (Ex 12:3-5, 1 Cor 5:7, 1 Peter 1:18-19). But note whose will was done (Prov 19:21).

Exodus 12:3-5  Tell the whole community of Israel that on the tenth day of this month each man is to take a lamb for his family, one for each household.  If any household is too small for a whole lamb, they must share one with their nearest neighbour, having taken into account the number of people there are. You are to determine the amount of lamb needed in accordance with what each person will eat.  The animals you choose must be year-old males without defect, and you may take them from the sheep or the goats.

1 Corinthians 5:7  Get rid of the old yeast that you may be a new batch without yeast—as you really are. For Christ, our Passover lamb, has been sacrificed.

1 Peter 1:18-19  For you know that it was not with perishable things such as silver or gold that you were redeemed from the empty way of life handed down to you from your forefathers,  but with the precious blood of Christ, a lamb without blemish or defect.

Proverbs 19:21  Many are the plans in a man’s heart, but it is the LORD’s purpose that prevails.

The death of Jesus was proven by the thrusting of the spear into His side as seen in the next verse.