I tried to read it aloud in a single breath, and I managed it ! anyway, it´s a strange world, without punctuation...!
Back to the crux, then.
Yesterday I also got off early but I didn't know beforehand so I didn't return my movies
beforehand would mean "initially/early" but it wasn´t expressed what "I didn´t know (early/initially)... Normally, it would be expressed.
Anyway, it kinda hints that he/she had not "anticipated something..." so he/she didn´t return their movies, what would be wise (or required) to do so.
One word after beforehand (for example - it/that, etc...) would be normal, this way we would have "...but I didn´t know it/that...beforehand". Of course, one would have in a previous paragraph stated who or what "it/that" was.