What you want me to do now? look at all three script and tell you what I like most? I closed 4 & 6 after it took more than one minute to load.
Sorry, but you have so much errors in the beginning, before you create any orientation for laser cutting, please fix your script. Sorry but nobody here has time to go threw your 1000 components, and search the errors.
Ofc every sorting and orientation go wrong, when you have one rib flying threw space. Stop working with it and repair it instead.
If you come back with one cleaned and understandable script, I will have a look, but not like this.