I’m pretty sure it goes like this in CL in the following order:
Tiebreakers
Points in head-to-head matches among tied teams;
Goal difference in head-to-head matches among tied teams;
Goals scored in head-to-head matches among tied teams;
Away goals scored in head-to-head matches among tied teams;
Because you lost 1-4 at home to Pata FC yet only won 2-3 when you played Pata away, the away goals criteria and goals scored applies. That’s why Pata finished above you even though the overall goal difference is one less than yours.