The robot drove round and round, recognised two places, and now knows its odometry lied. The path does not close, and the map built along it would show every wall twice.
You write the optimiser that pulls the path together: the edge Jacobians first, then the Gauss-Newton loop with the anchor, then an experiment on how many iterations it needs.