Four years ago, the 49ers capped a disastrous, no-good, nothing-could-go-right 2020 season with a loss at State Farm Stadium in Glendale, Arizona — their temporary home amid the COVID pandemic.

So the venue was certainly fitting for the end of another disastrous, no-good, nothing-could-go-right season on Sunday.

The 49ers finished the 2024 season with six wins and a last-place finish. Thinking back on the last 18 weeks, that status almost feels too positive for this embarrassment of a team.

And that’s not my adjective. It’s star defensive end Nick Bosa’s:

“Kind of an embarrassment. It doesn’t feel good. It’s hard to look the guys in their faces as a leader on the team, and that’s the product that we keep putting out game after game. It’s pretty embarrassing,” Bosa said after the Niners’ 47-24 loss to the Cardinals.

Yes, the 49ers entered the season with a Super Bowl-or-bust attitude, but it busted out well before Sunday.

Was it Week 15, when the Niners effectively eliminated themselves from playoff contention, or the abysmal losses to bookend Thanksgiving that did the 49ers in?

Or was the late-game choke loss to the Seahawks in Week 11 the death knell?

Maybe it was Week 7 when the Chiefs came to town and stomped them in a Super Bowl rematch, with the Niners losing Brandon Aiyuk for the season.

The two early-season collapses to the Rams and Cardinals were certainly ominous.

Or one could argue that this season was over after Week 1 — arguably their best win of the season. That’s when MVP-caliber running back Christian McCaffrey was ruled out at the last minute. The Niners kept him out for two months after that.

Maybe the 49ers’ season was cursed before it even officially started, when their training camp was marred by aimless, blubbering contract negotiations with Trent Williams and Aiyuk, a rotating list of absentees and a sense of entitlement that was never close to justified for this season.

Oh, and the team’s first-round pick was shot in San Francisco on Labor Day weekend. (Ricky Pearsall, it should be noted, recovered and played as well as any 49er in the season’s final weeks.)

So, no, this was not just a “down” year for the Niners. It was a culmination of three or four bad years into one.

And to fix it, the Niners’ braintrust — head coach Kyle Shanahan and general manager John Lynch — need to do the work of three or four good offseasons in the seven months before training camp 2025 arrives.

This kneecap of a campaign, now mercifully over, will, like the 2020 season, define Shanahan and Lynch.

The duo built this team up, went to a Super Bowl, lost, and then fell apart the season after.

But the 2021 49ers were young and spry, and they bounced back. The Niners followed a tough 2020 with three straight NFC Championship Game appearances, proving that infinitely injurious season was merely a blip. Yes, after resurrecting this organization from the depths of ineptitude, Shanahan and Lynch’s program proved resilient and it became the envy of the league, spawning copycats from coast to coast.

But here’s the thing about the NFL: Unless you have Tom Brady or Patrick Mahomes at quarterback, you’re not built for sustainable success. The acronym might as well stand for “Not For Long.”

Annual poaching from other teams looking for a bit of the 49ers’ secret sauce depleted the team’s deep bench of players and coaches. Shanahan and Lynch, undoubtedly constrained by a shorter offseason than their peers, proved incapable of replenishing it.

And that issue is most responsible for this 2024 collapse. They did not have the same luck as prior 49ers teams or the roster depth and coaching brainpower to remain competitive as injuries mounted.

If this were a worse operation, Shanahan and Lynch would be looking for new jobs. The 49ers were once that bottom-of-the-barrel operation. Don’t forget that Shanahan was the team’s fourth head coach in four years when he arrived in Santa Clara.

But that’s no longer the case. With Shanahan and Lynch calling the shots, the Niners have become one of the steadiest franchises in the NFL. Yes, this is their mess: You’d be hard-pressed to find a team that wasted more money in free agency, all while putting together three of the worst draft classes in the league before a solid 2024. But Shanahan and Lynch deserve the opportunity to clean it up.

Where to begin?

Frankly, there’s so much to do, anywhere will do.

There are big things, like if they’ll fire their defensive and special teams coordinators and how much they’ll pay quarterback Brock Purdy on a new contract. (That is, if they pay him.) Will Deebo Samuel stick around for another season? That’s a big call to make, too.

There are the obvious things, like nailing both free agency (even with Purdy signed, they’ll have money to spend) and the draft, as this team needs to replenish its depth overall, with a special focus on its offensive and defensive lines.

And then there are the little things, like making sure the next batch of entry-level coaches and front-office executives have the moxie and brainpower to quickly move up the ladder, as so many members of the Santa Clara diaspora did before them.

Between July 2024 and January 2025, it seemed as if nothing went right for the Niners.

Between January and July 2025, nearly everything will need to go right.

If that happens, perhaps the Niners can talk about winning a sixth Super Bowl title again in the near future.

But the right to consider themselves perennial contenders to the crown? That was the 49ers’ most significant loss of the season.