SANTA CLARA >> As shadows encompassed Levi’s Stadium field, left tackle Trent Williams got escorted by a referee to the 49ers sideline, ejected for throwing an after-the-whistle punch at a Kansas City Chiefs defender.

Don’t take it as though the 49ers went down fighting Sunday. No, a better metaphor was Mitch Wishnowsky’s onside kick that didn’t even make it five yards in the closing minutes.

This 28-18 defeat showed the 49ers are nowhere close to dethroning the two-time defending champions.

While Patrick Mahomes made timely plays against the 49ers’ defense similar to last season’s Super Bowl theatrics in overtime, 49ers counterpart Brock Purdy had three passes intercepted, the final of which came in the end zone with 9:29 remaining.

Purdy did produce a pair of 1-yard touchdown runs, but Mahomes had one himself as the Chiefs essentially controlled most of the game.

Purdy’s starting wide receivers, Deebo Samuel and Brandon Aiyuk, didn’t last the first half to further hamstring an anemic offense against the Chiefs’ shrewd scheme and powerful linemen. Samuel briefly tried playing though a pregame illness, Aiyuk sustained a knee injury just before halftime that could have lasting ramifications.

The 49ers (3-4) host the Dallas Cowboys next Sunday before reaching a Week 9 bye. The Chiefs improved to 6-0 this season, and coach Andy Reid improved to 22-4 coming off a regular-season bye in his career.

The 49ers’ greatest bright spot came from the mere debut of rookie wide receiver Ricky Pearsall, who 50 days earlier survived a gunshot wound through his chest in a San Francisco robbery attempt. Pearsall had three catches for 21 yards.

And yet, the 49ers’ receiving corps was still too thin for Purdy to counter Mahomes’ production. The 49ers’ top three wide receivers were unavailable for a second-half comeback bid: Aiyuk was in the locker room, Samuel was out of uniform on the sideline, and Jauan Jennings not suit up at all because of a hip injury.

Aiyuk got injured once hit by defensive backs Trent McDuffie and Chamarri Conner at the Chiefs’ 14-yard line, the price for making a 15-yard catch that set up an Anders Carlson field goal for a 14-6 halftime deficit.

Two series before that, Aiyuk dropped a third-down pass at the Chiefs’ 40-yard line, eliciting boos from the home crowd. The next series ended with a third-down overthrow toward Aiyuk. He finished with two catches on six targets for 23 yards, and he’s yet to register a touchdown pass in seven games, since signing a four-year, $130 million deal.

Sunday’s receiver issues really showed in the third quarter when Purdy’s pass to a wayward Ronnie Bell got intercepted at the Chiefs’ 25-yard line by Chris Roland-Wallace. Purdy’s more damning interception came when his arm got hit by George Karlaftis (who beat right tackle Colton McKivitz) and landed in Jaden Hicks’ enemy hands in the end zone, with the 49ers down 21-12.

George Kittle finished with a team-high 92 yards on six catches, and Jacob Cowing’s first two career catches went for 51 yards.

While Purdy was 17-of-31 for 212 yards, Mahomes also wasn’t lights out, completing 16-of-27 passes for 154 yards with interceptions snagged by Kalia Davis and Deommodore Lenoir.

Mahomes’ rushing ability, which converted a fourth-down keeper on their Super Bowl-winning drive eight months ago, helped the Chiefs pull away for critical points in the fourth quarter. Mahomes scored on a fourth-and-goal keeper from the 1, and he punctuated that touchdown by throwing a left shoulder into safety Malik Mustapha.

Earlier on that drive, Mahomes created a career-long 33-yard run by racing down the left sideline.