Bailout for duplicateBranch check if branches are empty (#5354)