You either passed an invalid lock type or tried to lock a byte range exclusively after you opened the smart large object in read-only mode.
Check these two cases and use a valid lock type.