LeBron James may well have made a game-winner against the Mavericks, but they gifted him a free throw instead. (Getty Images)

Luka Doncic did the work. After an underwhelming three quarters, the 19-year-old led the Dallas Mavericks back from a 13-point fourth-quarter deficit, scoring nine points on three shots, including a 7-foot floater that tied Wednesday’s game against the Los Angeles Lakers with seven seconds left.

Wesley Matthews undid the work. After an encouraging outing, the 10-year veteran gifted the Lakers their third win in eight games to start the season, (intentionally?) fouling LeBron James 25 feet from the basket on the ensuing play. Maybe Matthews didn’t know the score or thought the Mavs had a foul to give, which they hadn’t since committing their fourth team foul with 8:12 left in the final frame.

The result was two free throws for James, who missed the first and made the second, giving the Lakers a 114-113 edge with two seconds left. J.J. Barea’s heave sailed wide, and Matthews’ gift was a wrap.

Doncic and Matthews switched roles, as the former was visibly frustrated by the latter’s rookie mistake. Who is to say James would not have cruised in for a layup in those final two seconds. He had already beaten Matthews off the dribble, but both Doncic and DeAndre Jordan were shading into the lane to stop that freight train. Either way, the Mavs would have been better off finding out the result.

Doncic’s frustration subsided quickly after the game, when the wide-eyed teen told reporters through a smile, “I just got to play against my idol.” James returned the gift, signing a jersey for his admirer.

Wednesday night’s game will do little for Matthews to curry favor with Mavericks fans who would like his expiring $18.6 million contract to be traded or his minutes to be allotted elsewhere, despite his 18.6 points-per-game average through eight contests. This video from Mavs Moneyball’s Nick Angstadt titled “This is why Mavs fans are so mad at Wes Matthews right now,” does a nice job highlighting the “10 percent of the time Wes Matthews will do something that just does not make sense.”

That four-minute clip features a turnover against the San Antonio Spurs and a forced 3-point attempt against the Atlanta Hawks that both cost the Mavericks late chances to earn two more victories. The latest one improved the Lakers to 3-5 and helped LeBron avoid his team’s worst start since his rookie season from growing worse, all while dropping Dallas to 2-6, within a half-game of the West’s worst record.