Homer awakens in a utopian Springfield where everything and everyone is made out of Lego. While visiting the Lego Comic Book Guy's store to pick up a toy set for Lisa's birthday, Homer has a vision upon touching the box where he sees his normal cartoon self giving the gift to Lisa and helping her build it, which disturbs Lego Homer. Although Lego Marge tells him it was just a dream, Homer begins to have hallucinations of being flesh-based everywhere he goes. Meanwhile, Lego Bart inadvertently destroys the school building while chasing a skunk brought by Milhouse for "share day". Principal Skinner sentences Bart to rebuild the school, suppressing all creative attempts Bart makes at remodeling the building.
Homer continues to see himself and other Lego Springfieldians as ordinary people, which culminates with his hands turning into flesh while attending church for all to see. Going to the Android's Dungeon for answers, Homer touches the toy box again and has another vision of his cartoon self building a Lego model of Springfield with Lisa for a Lego construct contest, elated that he has found a common interest with her. However, Lisa instead decides to go see the new Survival Games movie (a spoof of The Hunger Games) with older girls, forcing Homer to enter the contest by himself. As Homer wishes he could live in the Lego Springfield he created with her, where "everything fits together and no one gets hurt", Comic Book Guy's giant Lego construct of Kendah Wildwill (a parody of Katniss Everdeen from The Hunger Games) falls on Homer, knocking him unconscious. After being told by Lego Comic Book Guy that their world is a fantasy where Homer can live out his desire to spend time with Lisa forever, Homer accepts the false reality.
While playing with Lego Lisa, Homer realizes that he will never experience her or the rest of his family living out their lives, and decides he must return to reality. Homer returns to the Android's Dungeon and learns that opening the toy box will end his fantasy. However, Lego Comic Book Guy reveals himself as the part of Homer's psyche that prefers the Lego world over the real world. He proceeds to fortify his store and sets Lego pirates and ninjas on Homer to keep him from reaching the box. Hearing Homer's cries for help, Lego Bart builds a giant robot from various play-sets and takes down the pirates and ninjas before crashing onto the store. Homer finds the box in the rubble and opens it, changing back to his normal cartoon self. He kisses Lego Marge goodbye before jumping into the box.
Homer regains consciousness at the Lego contest and reunites with Lisa, who had come after feeling bad about leaving him. He tells Lisa about his dream and the lessons he has learned about parenting. When Lisa starts to compare his dream to the plot of The Lego Movie, Homer quotes "No, this is a new plot" as life-sized constructs of the movie's characters Emmet and Wyldstyle are carted in the background. Homer allows Lisa to see the Survival Games movie, telling her he can't stop her from growing up. Soon after, Homer and Marge sit behind Lisa and her friends at The Survival Games, with Homer complaining about the movie while Marge enjoys it and repeatedly shushes him.