"Firstborn" did not mean the order of birth in the ancient eastern culture. It was usually the eldest child but it more specifically referred to the privileges of the child. For example in the book of Genesis we read that Esau was able to sell his "firstborn" right to Jacob is younger brother.
However, it was also prophesied that King David would be the "firstborn":
I have found David, my servant... And I will make him the firstborn, the highest of the kings of the earth. -- Psalm 89:20,27 (ESV)
"Firstborn" is not the order of birth. David was not the eldest child, neither was David the first king of Israel.
"Firstborn" is means the most important child. In this case David was considered "the highest of the kings of the earth".
This make sense if you also consider:
Grace to you and peace from Him who is and who was and who is to come, and from the seven spirits who are before His throne, and from Jesus Christ the faithful witness, the firstborn of the dead, and the ruler of kings on earth. -- Revelation 1:5
He has delivered us from the domain of darkness and transferred us to the kingdom of His beloved Son, in whom we have redemption, the forgiveness of sins.
He is the image of the invisible God, the firstborn of all creation.
He is the beginning, the firstborn from the dead, that in everything he might be preeminent.
-- Colossians 1:13-15,18
When Jesus is called the "firstborn of all creation", it does not mean he was first created, but that rather that he is the most important brother (Romans 8:29) born in creation.
But in fact Christ has been raised from the dead, the firstfruits of those who have fallen asleep. -- 1 Corinthians 15:20 (ESV)
Again Christ was not the first person to be revived from the dead. The following people were raised from the dead before Jesus died:
|Person revived||Who performed the miracle||Scripture|
|Son of a widow in Zarephath||Elijah||1 King 17:17-24|
|A Shunammite woman’s son||Elisha||2 Kings 4:18–37|
|An unnamed man||Elisha||2 Kings 13:20–21|
|Son of a widow from Nain||Jesus||Luke 7:11–17|
|Jairus’s daughter||Jesus||Luke 8:40–56|
Again, firstfruit does not mean the fruit that first was harvested, but instead it means the "best" fruit.