The Knicks trudged off the Sacramento court late Friday night heads bowed — the 2012 portion of their schedule ending in heartbreaking, buzzer-beating defeat that ruined what would have been a historic comeback.

But the depleted Knicks also walked off with the knowledge the next time they play on Tuesday, Amar’e Stoudemire, a six-time All-Star, will likely make his season debut. Things are about to get even more fascinating for a club off to a terrific 21-9 start.

“It’s frustrating and it makes this flight definitely long, hearing about the snowstorm back East,’’ said center Marcus Camby in the visitor’s locker room in Sacramento late Friday night. “But we got Amar’e back soon, so there’s a lot of smiles on our faces.’’

Stoudemire has set the next game against Portland as a “goal’’ for his debut. The Knicks could also have back Carmelo Anthony, out the last two games with a swollen knee, and Rasheed Wallace, who has missed the last eight games with a sore foot. (Tyson Chandler sprained his right ankle against the Kings, but seemed unworried he would miss time.)

Coach Mike Woodson said Stoudemire will scrimmage today and tomorrow for the first time with the team since knee surgery Nov. 1. The Knicks power forward said Friday he still had to meet with the medical staff to get final clearance. It was an odd remark since Stoudemire was cleared for contact scrimmages with the D-League club two weeks ago.

“I’m hoping Amar’e gets back as quick as possible,’’ Chandler said. “He’s one of the great players in this generation. We definitely want him on the floor.’’

Any talk of Stoudemire’s return setting the Knicks back is silly now. The Knicks are too old and injury prone not to need bodies, plus Stoudemire and Anthony now have a smart point guard in Jason Kidd to make it work. In fact, Stoudemire could even start by default because of injuries.

Asked if two practices are enough, Woodson said: “We have no choice.’’

For the second straight game the Knicks were beyond depleted against the Kings — missing Raymond Felton, Anthony, Wallace, Stoudemire and Iman Shumpert, who could make his season debut in mid-January.

Woodson said Stoudemire won’t be playing “30 minutes’’ at the outset. He has been projected to come off the bench Tuesday, unless the Knicks don’t have enough healthy bodies, particularly if Anthony is not ready.

“His coming back is a great thing,’’ former Knicks president Isiah Thomas said Friday on South Florida radio. “When you add good players, it’s good especially when you’re winning. The good and great players know at the end of day it’s all about winning. If a team is having success, a great player will accept their role. Stoudemire won’t have a problem coming off the bench if that’s what Woodson decides. … When you walk into a winning situation, that player will accept his role.’’

On Friday, with only 10 players healthy enough to suit up, the Knicks fell behind by 27 points late in the second quarter before mounting a comeback for the ages, taking a 4-point lead with 41 seconds left. The largest known comeback in their history was foiled by a 3-point shot at the buzzer by Kings reserve forward — James Johnson — who previously was 0 for 11 on treys this season.

But the will to fight in the second half on the third game in four nights out West with a depleted unit was another feather in the Knicks’ cap, a cap that reads “Championship contenders.’’

“When we fight, we fight hard,’’ Chandler said of their 55-35 second half. “It shows how good we could be defensively. We didn’t give up. We could have — a long road trip, this one got away from ourselves and let’s go home…. It took a lot to fight back. I’m proud of the guys. It’s a tough loss but we battled our hearts out.’’