I wish I knew, but I don't. It's only throwing the error on 2022 so I can only presume it has something to do with some changes in the underlying libraries I am referencing.
The blocks are standard blocks with nested blocks in them. The blocks have a series of attributes associated with them.
When toggling, the function creates a selection set, opens for read each block, then iterates through each attribute. If the tag matches a filter, UpgradeOpen is called, the visible property is set to false, then DowngradeOpen is called. Once the iteration is completed, the transaction is committed.
Toggling the visibility makes no difference when using it independently of the insertion process. It only happens when the blocks are inserted.
When I get a VM I can test on, then it will be easier to isolate.