Transverse spherocity is an event shape observable having a unique capability to separate the events based on their geometrical shapes. Recent results from experiments at the LHC suggest that transverse spherocity is an important event classifier in small collision systems. In this work, we use transverse spherocity for the first time in heavy-ion collisions and perform an extensive study on azimuthal anisotropy of charged particles produced in Pb–Pb collisions at TeV using a multi-phase transport model (AMPT). The azimuthal anisotropy is estimated using the two-particle correlation method, which suppresses the non-flow effects significantly with an appropriate pseudorapidity gap of particle pairs. The results from AMPT are compared with estimations from PYTHIA8 (Angantyr) model and it is found that with the chosen pseudorapidity gap, the residual non-flow effects become negligible. We found that the high spherocity events have nearly zero elliptic flow while low spherocity events contribute significantly to elliptic flow of spherocity-integrated events.