Stats are also recalculated immediately if a Vitamin or stat-reducing Berry (see below) is used on the Pokémon.
source
So the most likely explanation is that Dragonair gained a bunch of HP EVs since it last leveled up, but the EVs haven't started affecting its HP stat yet. When you use a protein, it recalculates all of Dragonair's stats, including HP, so the new EVs get to raise the HP stat.