TORONTO — Ryan Madson admitted he had been thinking about it lately, the fact that he hadn’t allowed a home run in a while, though he didn’t know exactly how long. Veterans such as Madson know about baseball’s pendulum and its maddening power to turn what might be a source of pride — such as, say, not giving up home runs — into something ominous. Whatever the statisticians say, baseball players believe in the notion of “due,” and perhaps for Madson it fostered some kind of subconscious doubt.

That’s because more than a year after he allowed his previous homer — he had not given up one as a National — Madson allowed two of them to back-to-back batters in the eighth inning of Washington’s 8-6 loss Sunday to the Toronto Blue Jays. The shots sent the Nationals to an unexpected sweep at the hands of a team tied for third in its division, 15 games out of first.

“No command, really. Stuff was good but no command of it,” said Madson, who thought the fastball he threw to Teoscar Hernandez was a bad choice in a bad place. “. . . The second one [to Yangervis Solarte], I don’t know, that kind of surprised me. It’s been a long time since someone hit a curveball for a home run. But it’s going to happen.”

Such was the sentiment in the Nationals’ veteran clubhouse after the sweep. These things happen. They scored more runs Sunday than they had in a week. They battled back to tie the game twice in the later innings. Seasons are long; streaks never last. Michael A. Taylor is a perfect example of that baseball truth.

Taylor struggled so mightily in the first few months of the season that he seemed likely to lose his job. He tried to fix his swing, to shorten it, changing a few things to fix one.

Eventually, he and hitting coach Kevin Long decided he should go back to his strengths, to what feels natural. Taylor went 3 for 4 and stole four bases Sunday, scoring two of the Nationals’ six runs and saving a run or two defensively. He is hitting .392 in the past 14 games he has started.

“I think I’ve been really trying to stay in the strike zone and been a little more selective lately,” Taylor said. “I’m glad things are progressing on that front.”

Things progressed for this offense, too. Daniel Murphy hit the ball hard over and over and delivered an RBI single. Anthony Rendon continued to make solid contact. Juan Soto broke a brief hitless streak. Wilmer Difo chipped in two hits, including an RBI single. Brian Goodwin mustered one of those, too. Adam Eaton, coming off the bench, delivered a game-tying double. Only Bryce Harper, who went 0 for 5, remained mired in struggles. A day after being shut out for the third time in five games, the Nationals’ offense looked like a group more than capable of scoring.

Led by Taylor, they stole five bases. A sputtering team is often said to look “lifeless.” Lifeless-looking teams — like those who get swept — raise questions about effort. But these Nationals have been lively on the bases when given the chance and entered the day leading the National League in stolen bases. Occasionally, their aggressiveness has earned them unnecessary outs, but they cannot be accused of sitting around and waiting for the home run to save them. It was not the home run that saved them Sunday when their offense came back to life. They are pushing.

Tanner Roark, meanwhile, refused to put too much stock in what was the worst outing of his season. He lasted just four innings and needed 97 pitches to do even that. He permitted the Blue Jays to start and capitalize on two-out rallies in the second and third innings. Three times in three innings, he required a mound visit — twice from pitching coach Derek Lilliquist, once from catcher Spencer Kieboom. At one point, he and Kieboom mixed up signs. At another, Roark walked in a run. That run tied the game in the third. He allowed four runs on eight hits.

“I stunk today,” said Roark, who said he wouldn’t read much more into it than that.

Four of the five Nationals who pitched Sunday allowed runs. This staff owned the third-lowest ERA in the majors entering Sunday. Nationals pitchers struggled in two games over the weekend and performed well in one, though the offense let them down that day.

“We hit very, very well today. We played defense well,” Roark said. “Just one of those series, tough series.”

If the data accumulated by FanGraphs.com is accurate, Madson had never allowed a home run on a curveball before Solarte hit one out to right Sunday afternoon. He has now allowed two homers in his last inning of work, a statistic that will not be considered representative of his season as long as he recovers. The Nationals have lost five of their past six games as they head home to face the Yankees on Monday.

“It’s part of the season you’re going to go through. I don’t even think it’s that bad,” Madson said. “Our personalities are good. Our attitudes are good. We just want to play a game tomorrow.”