The retry loop captured initialCaps once before entering the loop.
If a try-tap failed to reach the host but the undo-tap in the catch
block succeeded, the host's actual caps state diverged from
initialCaps. Every subsequent iteration then toggled in the wrong
direction, guaranteeing the 15s deadline was exhausted.
Fix: re-read the LED state at the top of each iteration so the
expected value always reflects reality.
Made-with: Cursor