How to cycle through windows in a circle?

I’m trying to bind a key to cycle focus through windows. I’ve seen Next FlipFocus and Next Focus recommended elsewhere. This does seem to work, but it stops working after pressing it a few times. For example, with 2 windows, it will cycle focus between them 5 or 6 times and then it will stop working.

Here is the specific line of config I’m using:
Key F A M Next FlipFocus

I’m looking for a direction agnostic way to cycle through all windows without having to specify the direction.

Version: 2.6.9

Edit: I figured it out. I needed to have ClickToFocus enabled for the last solution on this page to work correctly.