WASHINGTON — President Trump is privately rejecting the growing consensus among Republican leaders that they may lose the House and possibly the Senate in November, leaving party officials and the president’s advisers nervous that he does not grasp the gravity of the threat they face in the midterm elections.

Congressional and party leaders and even some Trump aides are concerned that the president’s boundless self-assurance about politics will cause him to ignore or undermine their midterm strategy. In battleground states like Arizona, Florida and Nevada, Mr. Trump’s proclivity to be a loose cannon could endanger the Republican incumbents and challengers who are already facing ferocious Democratic headwinds.

Republicans in Washington and Trump aides have largely given up assuming the president will ever stick to a teleprompter, but they have joined together to impress upon him just how bruising this November could be for Republicans — and how high the stakes are for Mr. Trump personally, given that a Democratic-controlled Congress could pursue aggressive investigations and even impeachment.

Over dinner with the president and other Republican congressional leaders this month, Senator Mitch McConnell, Republican of Kentucky and the majority leader, phrased his advice for the president in the form of a reminder: Mr. Trump should never forget his central role in the 2018 campaign, Mr. McConnell said, explaining that Republicans’ prospects are linked to what he says and does and underscoring that their one-seat advantage in the Senate was in jeopardy.