I've used and not used 5e flanking in games and can confidently say that the rule as written was either written before move based AoO type rules were streamlined and simplified to nil or were written with the Express goal of thwarting tactical grid based combat strategy in play. Either way the rule is awful and should be avoided as free advantage is a gigantic bonus even by old school hit rate standards that 5e dramatically cranked up.