The gospel of Matthew has Jesus heal Peter’s mother-in-law after healing a leper and a centurion’s servant, which was just after the sermon on the mount.
According to Mark, Jesus healed Simon Peter’s mother-in-law and then healed the leper later.
And in the gospel of Luke, he doesn’t even start the sermon on the mount until two chapters after he heals Simon’s mother-in-law. He heals the leper in between, and the centurion’s servant after the sermon.