Click the structures and reaction arrows in sequence to view the 3D models and animations respectively
Lengthening the chain even by just one carbon as shown here, allows the endo-trig cyclization to occur. It is a perfectly straightforward 6-endo-trig cyclization for which orbital overlap presents no problem.
K. Gilmore and I. V. Alabugin, Chem. Rev., 2011, 111, 6513–6556.