Dear student
Initially hemichordates were kept in phylum chordata as they possessed a buccal diverticulum which was supposed to be a rudimentary notochord but later it was found out that this structure does not bear much resemblance to the notochord and also DNA analysis showed that hemichordates are closer to echinoderms than chordates. Hence, they were separated from chordates and made a different phylum.
Regards