However If moving your custom code make things function that weren't before, we can likely say that the issue is with the code & not with the Carousel update. This is a good first step, i have received your Github and will take a look but cant promise to fix your code for you, this unfortunately is up to you :)
What i really would suggest to help you debug further.
If you have a simple web document program or not even needed, just somewhere to past your code:
Take the time to remove each Custom Code area - until your Custom CSS,JS & HTML page is clear. If copy and pasted on a document then it will be safe and can just be added back again.
Then save and refresh - Does Lay Theme function correctly now?
No third-party plugins?
Then add the Custom Code back in one area at a time e.g 'Custom CSS' area - then 'CSS for Desktop' area.
Refreshing & saving the website each time to see if the clash occurs. When the error happens you have isolated which 'Code Chunk' is likely to blame.
From there you can debug further by adding smaller 'chunks' of that larger code 'chunk' one by one to see when the clash occurs again.
I know this can be time consuming and rather frustrating, but not as frustrating as looking at all the code and wondering where even to begin.
Hope this helps, I only mean well :)