ok, now it gets REALLY weird!
after running the script a couple of times with the same result, crash of cinnamon i added an exit statement close to the end of the script:
this time i had no crash.
so i removed that statement again and... no crash anymore!
I was running that script a couple more times, always the same result, no crash anymore!
thats really weird!
I have had the same behavior on both of my systems, my ubuntu 16.04 box and on my 18.04 one.
Well... case closed, put it to the "X"-Files...