No, this is not a bug, it’s not necessarily goal difference that decides who wins the group, in this case, it was head to head which determined who topped the group.
As you stated, Team one won 1-0 and then lost 3-2 to team two.
This would give an aggregate score of 3-3, team one goes ahead of team two because they scored more away goals during the two games than team one.