We report our transmission electron microscopy observations of erratic dislocation behavior within funnel-like defects on top of AlN templates filled with AlGaN from an overlying epitaxial layer. This dislocation behavior is observed in material where phase separation is also observed. Several bare AlN templates were examined to determine the formation mechanism of the funnels. Our results suggest that they are formed prior to epitaxial layer deposition due to the presence of impurities during template regrowth. We discuss the erratic dislocation behavior in relation to the presence of the phase-separated material and the possible effects of these defects on the optoelectronic properties.