It was a risky move. The Democrats in the U.S. House basically forced the opposition to either disavow democracy which would disrespect the voters members of Congress will themselves be appealing to in a month and a half, or to take a vote that discredits and rebukes their own Presidential nominee in the same election. If Republicans in the U.S. House had backed the President as the five dissenters did, the vote would have set the stage for a likely self-coup attempt if Trump does not win the election.
This gambit was successful. Trump's extra-legal rhetoric was publicly rebuffed and rejected by all but about 5 members of his own caucus in the U.S. House out of 185. The measure was adopted in a bipartisan 397-5 vote. (A U.S. Senate vote on a substantially similar resolution, held September 24, 2020 was unanimous.)