Is the Pidyon haben done to exempt the firstborn from his original duties to the Beit Hamikdash?
I heard that, since Hashem saved the Jewish firstborns from the Makat Bechorot, when they also should have died, they created a debt with Him that would be paid with their work at the Beit Hamikdash. But, as we know, they lost this privilege, which was transferred to the Levyim, when they sinned with the golden calf. So, as they can't pay their debt by working anymore, they have to perform the Pidyon haben to be exempt from this duty.
Is this correct? If so, is it written somewhere?