The joke that Bender tells but never finishes (while crawling through the ceiling) actually has no punchline. According to Judd Nelson, he ad-libbed the line. Originally, he was supposed to tell a joke that would end when he came back into the library and said, “Forgot my pencil”, but no one could come up with a joke for that punchline.
Did they just make up this entire movie on the spot.
Yes, yes they did.