If the skeleton actually has cycles, you need to detect and repair them. I made a HDA for this purpose (I'm not sure why this isn't built into Houdini to be honest)
It can mark, split or remove cycles. Marking cycles can help for other graph traversal problems too.
Download here:
https://github.com/MysteryPancake/Houdini-Fun/tree/main?tab=readme-ov-file#hda-repair-cycles [github.com]