In Matthew 28:19 Jesus explicitly commands his apostles to baptize in the name of the Trinity. This is where the Church received the Trinitarian formula. It wasn’t some pope’s idea. In Acts 2:38 the author is not presenting a liturgical formula. He is concerned with distinguishing Christ’s baptism from John the Baptist’s. The practice of the early Church was thoroughly Trinitarian. For further information, go to https://www.catholic.com/tract/trinitarian-baptism.