You can’t update containers like this:
col.children[1] = allfigs.children[index]
in the browser. This is possible in Python (to some extent), because we wrap built-in types. This isn’t done on JS side, so you have to update entire objects instead of their items, e.g.:
var children = [...col.children] // or use .slice()
children[1] = allfigs.children[index]
col.children = children
With this change updating layout should just work. Note that there are some properties that aren’t hooked up with change listeners, so other things may not work without a little more push (e.g. #7357).