I am not sure why it doesn't work - but I sometimes also experience local errors with code that doesn't work on some part of my program even if the code looks identical to other parts that does work... I am working on a massive e-learning with +50 videos rigth now and I am already seeing strange problems like this... However I have a feeling that it you start with a completely new slide (without copied code) and do things manually, it usually works all the sudden.
Another thing to try, is instead to have the user click an X for closing the slide layer, you can also choose to Hide layer when Timeline finish - and then make your dialog long enough for the user to read it, before it close your slidelayer down and continue from the baselayer.