Genesis 35:16-18 NIV
16 Then they moved on from Bethel. While they were still some distance from Ephrath, Rachel began to give birth and had great difficulty. 17 And as she was having great difficulty in childbirth, the midwife said to her, “Don’t despair, for you have another son.” 18 As she breathed her last—for she was dying—she named her son Ben-Oni.[h] But his father named him Benjamin.[i]
Genesis 37 NIV
28 So when the Midianite merchants came by, his brothers pulled Joseph up out of the cistern and sold him for twenty shekels[b] of silver to the Ishmaelites, who took him to Egypt.
In the above texts we are first told of the birth of Benjamin in Genesis 35 then later told of the enslavement of Joseph.The timeline is not clear whether Benjamin was born before or after Joseph was sold to the Egyptians.
When was Benjamin born?