Are you getting any error messages? Does it work if you just run it once without the loop? For example, to my knowledge there is no such message in JSL as << Delete Children which makes me ask: has this been created using some LLM such as ChatGPT?
-Jarmo