James Paxton entered Tuesday night with a 0.34 ERA at Yankee Stadium this season.

He ended it by being booed off the mound when he was knocked out in the third inning of the Yankees’ 10-4 loss to the Mets in the nightcap of a split doubleheader.

It was the second straight rocky start for the left-hander, who spent time on the injured list with left-knee inflammation and is still pitching with a brace.

Afterward, Paxton said he didn’t think his struggles have been because of the knee.

“I don’t think that’s a factor,’’ said Paxton, who allowed six runs in 2 ²/₃ innings. “It was just a bad game on my part.”

As for the brace, Paxton said: “I don’t think that’s an issue. This is just a little bit of a rough stretch right now. I’ve got to get back to work and figure out what I need to do to help this team win.”

He didn’t give them much of a chance on Tuesday. Paxton allowed a chopper that went down the right-field line for a double to Jeff McNeil to lead off the game and a flare to left to J.D. Davis before Pete Alonso crushed homer that made it 3-0 just three batters into the game.

Things got worse in the third, as Paxton gave up three more runs before being pulled with two outs. It was his shortest outing of the year and he still gave up a season-high six runs.

“I just wasn’t very good,’’ Paxton said. “That one’s on me. … It’s tough. I’m gonna do whatever I can do so I don’t let the team down like I did today.”

Aaron Boone noted Paxton’s command was off, but the manager said he believed the lefty’s knee was OK.

“I think it’s fine,’’ Boone said. “We’ll check with him again tonight and [Wednesday]. I didn’t think he was far off from being himself. He was not real sharp and not overwhelming from a stuff standpoint.”

Paxton hadn’t allowed an earned run in his previous four starts at Yankee Stadium, where he had previously complained about the mound, which he thought might have led to his knee issues.

But after tossing four no-hit innings against the Padres in his return from the IL, Paxton allowed four runs in 4 ²/₃ innings in a loss in Toronto his last outing before being roughed up by the Mets on Tuesday.

“I by no means pitched well, but they swung pretty well, too,’’ Paxton said of the Mets’ lineup.

And he acknowledged it was difficult hearing it from the crowd after it was over.

“I’ve had a lot of success here this year,’’ Paxton said. “It’s not my first tough one and I’m sure it won’t be my last. But I’ve dealt with failure before and I’ll bounce back like I have before.”