Lvl and space(position) don't matter, only attack order and refinements do. So if both heroes are 1st in their teams then whoever has higher initiative goes first. So your opponents had higher refinements or same refinements but higher battle armor rank. Anyway they had higher initiative. It's not a bug.
P.S. Next time make screenshots, it's a lot easier to understand the problem when you have visual information.