I am not sure how it is possible the chain in the locker would be affected by the swing at anchor.
I can see how possibly as you pul the chain up after a long stay at a place where the wind
and tide made you rotate through the same direction over and over that this would, after you hauled up the chain - induce a twisted pile in the locker, but it is not possible to transmit chain twist past the windlass.
It is more likely that you hauled up your anchor after a stay in a deep anchorage? And possibly you hauled a long set of chain up without looking? This can happen and the pile tips over, more chain piles on, pile tips over, more chain piles on - and now you have a mess than wont release easily for the next anchoring
issues are related to the previous anchoring experience.