It is a progression, not a regression
Around 3 to 5 months, sleep changes from two stages to four stages, closer to adult sleep. This is a leap forward in brain development.
Because the cycles are lighter and longer, babies wake more between them. It looks like sleep got worse, but the underlying system got more mature.