On consecutive nights early last week at the Wells Fargo Center, first the Flyers lost to their chief rival, then the Sixers lost to theirs.

Both were excellent losses.

The Flyers and Sixers players left frustrated. Their fans departed deflated. But players and the fans are saddled with the burden of bias. Objective observers were not nearly as pessimistic.

Of course, what happens next matters more, especially now that Sixers center Joel Embiid has been sidelined with knee soreness.

Four of the Sixers’ next five games will be against playoff-caliber teams; the last of those, on March 2, a circled-date, Saturday night visit from the Warriors, the league’s gold standard. And the one game against a non-playoff team will be in New Orleans, a talented squad but currently the unpredictable epicenter of NBA dysfunction.

The Sixers stand fifth in the Eastern Conference, which would cost them at least a first-round homecourt advantage, but they are only one game behind third-seeded Indiana.

The Flyers will visit Montreal on Thursday, then host the rival Penguins again on Saturday night in the Stadium Series game at Lincoln Financial Field. Both the Canadiens and Penguins have 71 points, eight more than the Flyers, as the bubble teams jockey for the final playoff spots.

The Sixers have 24 games remaining. The Flyers have 22. Yes, every win seems to count even more now, but, though it sounds counterintuitive, a loss can, indeed, prepare a team to win.

The Sixers lost, 112-109, to the Celtics on Feb. 12, their second-to-last-game before the All-Star break. The end was unfair: A foul went uncalled with 34 seconds to play. The means was unexpected: The Celtics received 32 bench points, including 26 and a season-high six three-pointers from Gordon Hayward, who has scored more as a Celtic just twice. The game carried a playoff atmosphere, charged with the energy of a bitter rivalry.

The Sixers, who had been rebuilt with five new players just four days before, held their own.

The Flyers lost Feb. 11 to the Penguins, a game in which they utterly carried play. The Flyers could hardly have played better; they set a franchise record with 28 shots in the second period and fired a total of 51 at Matt Murray, who stopped 50, a career high.

Evgeni Malkin returned from injury to help the Penguins end their four-game losing streak, and Sidney Crosby was both lucky and good; he had three points. The game turned on a disallowed goal in the second period because of a premature whistle from the referee. That goal would have cut the Penguins’ lead to 2-1 and changed the game’s momentum.

An empty-net goal made it a 4-1 final, but the score did not nearly reflect the play.

The Flyers gutted out a win the next night in Minnesota, then swept a home-and-home against the Red Wings on Friday and Saturday.

The Sixers ground out a win the next night in New York, then dispersed for their All-Star break.

The Flyers then lost Monday night to the Lightning, but the Lightning are the best team in hockey, and it wasn’t as bad as the 5-2 score and the early results made it seem. The Flyers were outplayed for the first 11 minutes, and rookie goalie Carter Hart proved to be human and was pulled. But the Flyers then played the Lightning evenly until an empty-net goal produced the final.

Brian Elliott replaced Hart and played for the first time since a core muscle injury sidelined him in mid-November. The Flyers scored just twice, but that’s because the NHL speciously ruled goalie interference on a last-minute score that would have cut the lead to 4-3. Instead, an empty-net goal produced the 5-2 final.

Also: Lightning goalie Louis Domingue was stand-on-his-head good. In a three-save sequence late in the second period, he looked like Jean-Claude Van Damme when, lying on his back, he rolled over and kicked a puck out of midair.

It was not a great loss, not as good as the loss to the Penguins, but it wasn’t bad. It was nearly inevitable, even for a Flyers team whose 12-1-1 run had resuscitated its season.

Are we looking too rosily at the inherent ugliness of these losses? Are we diminishing reality?

Yes, the Celtics played without Kyrie Irving last week. But the Sixers lost the Eastern Conference semifinals to the Celtics in five games last spring and faced neither Irving nor Hayward, and they are 0-3 against Boston this season, 2-10 in their last 12 games, including playoffs. This was one of the better losses.

Yes, the Penguins had lost four in a row, but they had won eight of the teams’ last 11 meetings, including playoffs.

Besides, recent losses by Philly teams have led to better results.

On their way to the second round of the NBA playoffs last season, the Sixers lost by three points to the Pacers on March 13. At the time, the Sixers were 36-29, riding a 13-game home winning streak and had incorporated Ersan Ilyasova and Marco Belinelli, but they were struggling to find themselves against better teams. They entered hoping to catch teams such as the Pacers, who entered with 39 wins, and the Heat, who had 36 wins but had just beaten the Sixers.

“With each one of those games, we learn a little bit about what we need to get better for the playoffs,” coach Brett Brown said at the time. “I think there’s tremendous learning power out of these games.”

They learned, and they won the next 16 games in a row, then beat the Heat in their first-round playoff series.

In Game 2 of the 2017 NFL season, the Eagles lost in Kansas City by a touchdown. They were tied until less than seven minutes remaining. The Chiefs were the best team in football over the first five weeks of that season, and the Eagles played them even-up, at maddening Arrowhead Stadium, for most of the game. It was a good loss.

The Eagles won their next nine games in a row, 12 of their next 13, and the Super Bowl.