Screen reader announcements in our project liveregion stay on for a set time before they get cleared. The hold is a number of milliseconds, and for a while it went straight to the browser timer. Zero or a negative number did not fail there. The timer read it as fire now, and the message was gone before anything could read it. Past the timer's ceiling browsers overflow the value, and the effect is probably much the same.
We now check the hold where it is given, not where the timer runs. Both places that take one run it through the same small internal check first. Finite comes first, so NaN and infinity get refused before any comparison happens. Then anything below one. Then anything above the largest delay a browser timer can hold, roughly 24 days in milliseconds.
The error names the setting, both bounds and the value that came in, so a zero hold gets reported where someone wrote it, together with the two numbers it had to sit between.
Changing the hold later goes through the same check before the stored settings are rebuilt, so a refused value throws and the hold in use stays as it was. The call that forwards it from the outer handle keeps no copy of its own, so a clear that is already armed keeps the length it was armed with, and nothing is left behind to disagree with the queue.
No queue in the library ends up with a hold it cannot keep.