I’m pretty sure that you’re correct. McCain hated President Trump exactly because Trump is/was President, and McCain is/was not.
My theory, at hundreds of miles distance, is that McCain was driven by bitterness and envy ever since GWB aced him out during the 2000 primaries. Bush, and later, Trump, won what he, McCain, could not.