That was actually one of two "extra" episodes Fox ordered last season. The extras are weird because of the way they had to be handled.
For some reason, for two seasons in a row, the network ordered these additional episodes when it was too late to integrate them into the season's arc, meaning the showrunners had to give them more standalone plot lines -- then, the first time (during season 2), Fox compounded the confusion by deciding the episodes would air during the following season, making them even more disconnected from the story's flow.
Then again during season 3, the episodes "Boo Normal" and "Once Upon a Time" were done with the idea that Fox would slip them into the next season -- but then the network canceled Lucifer instead, and aired those two after the real season 3 ender ("Devil of My Word") to burn them off.
THEN came the pickup by Netflix, for a tighter 10-episode season 4. If the show had stayed on Fox, with a 20-or-so-episode season, the showrunners would've had time to adjust the overall plotline around what happens in "Boo Normal" (the episode with "Rayray" aka the Angel Azrael), but with 10 episodes, it was probably best for them to just wave away the events of "Boo Normal" -- especially since the other thing in that episode that fits badly with the show's timeline is that Dan's post-Charlotte bitterness toward Lucifer isn't there.