This parish should not have given the sacrament of confession before the sacrament of baptism.
First, an individual does not have the rights to the sacraments unless they are first baptized. Baptism is the gateway to the other sacraments. The Catechism of the Catholic Church states:
Holy Baptism is the basis of the whole Christian life, the gateway to life in the Spirit (vitae spiritualis ianua),4 and the door which gives access to the other sacraments (CCC 1213)
Second, baptism washes away not only original sin but personal sins as well. Once again the Catechism states:
By Baptism all sins are forgiven, original sin and all personal sins, as well as all punishment for sin (CCC 1263)
Third, the sacrament of confession is for post-baptismal sins (CCC 1446).
So, the sacrament of confession should not have been given before the sacrament of baptism.