If the wire nutted splice is attached to a breaker, then it is OK. However, if the wire nutted connections are part of a pass-through, i.e., using the service panel as a junction box, then it is a big NO-NO.
Happens a lot with service changes (even though I know this wasn't the case here). The wire is not long enough for the new panel, so your choices are to have j-boxes all around the new panel or make your splices in the new panel. You are fine.