But as it turns out, this sequence wasn’t originally a part of the script. Screenplayed posted the scene on Twitter along with commentary from the director of the film, Todd Phillips. https://twitter.com/Screenplayed/status/1181962526558433280?s=20

In it, Phillips explains that the original script had Arthur panicking as he came dashing into the bathroom, puking and then staring at the mirror asking himself, “What have I done?” While this could’ve worked just fine, especially since Phoenix is such a terrific performer, it’s nowhere near as interesting as the sequence we eventually got in the film. Right as they were about to shoot, Phoenix and Phillips agreed that something wasn’t quite right with the way the scene was written — it didn’t feel like something Arthur would do. After about an hour of bouncing around some ideas, Phillips decided to play one of Hildur Guonadottir’s musical scores. The piece inspired Phoenix. Todd Phillips said: Joker is currently playing in Malaysian cinemas.  Click here to read our review of the film.

Joker  Poetic Bathroom Dance Scene Was Originally Something Entirely Different - 95