Base Prime Harald (Rock’s equal) > Prime Gaban much less Holy Knight Harald who’s gone up a tier.
So Gaban slightly out of his prime (at 64) + Young Shanks not being able to beat HK Harald is a logical conclusion.
Like has already been stated by someone on here already, the main issue with Holy Knight Harald & Domi-Reversi Xebec was that both could use CoC to defend and attack so they are able to cancel out their opponents CoC which is what can hurt immortals. Solution Roger & Garp came up with was an all or nothing strategy with both putting all of their Haki into their best attacks to get through Xebec’s defense.
So nothing short of that was going to break through Harald’s CoC defense. Even if Gaban knew that one solution unlike Roger or even Garp who are extremely rash characters by nature, I doubt he’d resorted to an insane strategy like that. Plus he’s not like he has the luxury of a Garp or Roger fighting alongside him.
Then there’s context of the fight which was to stall Harald till Loki came back with whatever trump card Harald tasked off him with the mindset of saving him. So Gaban & Shank’s mission in this fight was a battle of attrition with a character stronger than them who has infinite stamina & regen 💀 which they were able to accomplish successfully.
Also as an add-on:
Keep in mind that there’s no guarantee that whatever Loki was going to come back with was ultimately going to be successful against Harald so worst case scenario they’d have had to combine efforts with Loki to tango with Harald again in the case that he failed now imagine fighting a monster of Harald’s’ caliber till Loki gets back whilst also trying to preserve your own stamina as much as possible for potential extra time against him💀
Now whether Oda wrote them to think that far ahead is anyone’s guess but considering the circumstances if I were in their shoes I’d have had to.