Not necessarily. An unpopular leader can be even easier to overthrow, because the faction planning the coup has a higher chance of gaining popular support afterward. Or at least they can expect less resistance.
Of course, in reality, political and/or military leaders are often woefully bad at estimating how many people actually support them.