I don’t really think he did that deliberately, if you look close at the replay he was already turning away with his eyes elsewhere.
He just didn’t see her, and she is just not important enough to waste time with.
I on the other hand hope did not shake Pelosi’s hand deliberately.