Non-Hermitian extended midgap states and bound states in the continuum