ClosedBit error docs

CB_ERR_RANGE

Value out of accepted range. A number, index, shift amount, color, memory cap, or dimension is outside the supported range.

Why it happens

A number, index, shift amount, color, memory cap, or dimension is outside the supported range.

How to fix it

Check the message for the field name and clamp to the allowed range before passing it onward.

Copy-paste fix pattern
library CB-Math

fn main() {
    u256 shift = CB-Math.clamp(300, 0, 255)
    save one << shift
}
If the IDE reports a line number, fix that line first, then scan the previous line for an unclosed string, bracket, or block.