Twist gap and global symmetry in two dimensions