So John is fulfilling prophecy and doesn’t know his cousin, then why does the Bible mention that they are cousins?
Also, by what right did John call people to repentance and how could they repent prior to Christs death and resurrection?
All throughout the OT, we see the direction to those out of fellowship to return to God so He can return to them. Repentance isn’t unique to NT theology.
I would expect that he had known that Jesus was his cousin.
That doesn’t mean by default that he knew that Jesus was THE Lamb of God who takes away the sins of the world.