We do not see any contradiction with these shlokas. Govindarajar states Varuna is addressed as MahadevaH. The previous shloka states Shiva is also called MahadevaH.
The name MahadevaH has many meanings and even Perumal is eulogized as Mahadeva. Shrimad Ramayana states the Ranganatha Perumal worshipped by Lord Rama in their sanctum is also called Mahadeva. Mahadeva means mighty Lord.
The line “atra pUrvaM mahAdEvaH prasAdamakarOtprabhuH” states that Mahadeva has graced me refers to the help of Samudraraja or he may have referred Varunadeva because Shrimad Ramayana had never quoted Siva had graced them and no one had said so. The exponentiation clearly states Varuna is addressed as Mahadeva.