Your attack deals just over 50% of their HP. One more hit wins the game. Next turn: the move deals just under 50%. You low-rolled. The situation is reversed. ([Missing footnote: lowroll])
This is not bad luck in an isolated sense. At tournament level, players memorize exact damage ranges and avoid situations where a low roll costs them the match.