Hello Anh,
Interestingly, I've found that if set clone_default for the container groups to false, the TypeError error disappears.
Could clone_default be what triggers this error?
BTW, I've tried the previous code in a new WordPress installation with a TwentySeventeen and I still had the same TypeError problem.