The ending resolves Buzz's guilt by having him accept the colony as home, while a late scene leaves Zurg's fate open. Here is what happens and, in my opinion, why it works.
Zurg is revealed to be an older Buzz from another timeline, which explains the credit "Old Buzz". He wants to use the fuel to return to the day of the stranding and prevent it. Buzz refuses, because undoing the stranding would erase Alisha's life, her family and Izzy. When Zurg grabs the fuel in the crash landing, Buzz shoots it from his ejected position, and the explosion seems to end him.
What does that mean for Buzz? He stops chasing a way back and accepts T'Kani Prime. Commander Burnside restores the Space Ranger Corps, and Buzz leads Izzy, Mo, Darby and Sox with a fresh fuel crystal toward an unexplained signal.
It could be argued that the real ending is the choice, not the explosion. The film builds its emotional case early: every few minutes of test flight for Buzz costs years on the ground, so Alisha grows old, raises a family and dies while he is away. When Zurg offers to rewrite that, Buzz has already seen what the colony became without him. Zurg is what Buzz turns into if he never forgives himself, and the film asks him to let go of a perfect past in favor of a messy present. In my opinion, that is the strongest idea in the script.
The comparison with the main saga is useful here. In Toy Story (1995), Buzz believes he is a real space ranger and has to accept that he is a toy, which is a lesson about identity. In Lightyear, Buzz is the real ranger, and the lesson is about responsibility and time. It also rhymes with Toy Story 3, where Andy is 17 and heading to college, because both films are about watching people grow up and move on while you stay the same. The difference is that Lightyear makes Buzz the one who has to stop clinging to the past, not the toys waiting in a box.
The production context supports that tone. Director Angus MacLane and producer Galyn Susman took the crew to NASA's Johnson Space Center in Houston, and five NASA astronauts advised the filmmakers, according to Disney. Time dilation is a real concept in spaceflight physics, and the film uses it as an emotional device, not just a plot gimmick. Chris Evans voices Buzz in place of Tim Allen because the film is presented as the movie that inspired the toy, so the Buzz here is deliberately a different character from the one Andy plays with.
The later scene indicating that Zurg survived keeps the door open. Coverage of the credits scenes in Toy Story 5 also mentions a Zurg tease, though that is a separate film. As such, the safest reading is that Lightyear closes its emotional story and leaves a hook for anything that follows. The box office context is worth keeping in mind for any sequel talk: the film earned about $226 million worldwide on a $200 million budget, according to Box Office Mojo and The Numbers, and no follow up has been announced.