When thrown, the weapon is ranged.
From the Thrown trait:
You can throw this weapon as a ranged attack, and it is a ranged weapon when thrown.
When you Strike with a thrown weapon, you choose whether it will act as a melee weapon (by attacking with it normally) or a ranged one (by throwing it). In this case, Precise Strike would grant additional precision damage on melee attacks with the Combat Grapnel, but not its thrown attacks (though you could use Flying Blade to get around this restriction within the first range increment).
As far as I'm aware, Pathfinder 2e lacks the distinction like the one mentioned in 4e D&D. Some actions that require melee weapons will use language like the Swashbuckler, ex. "a Strike with a melee weapon or unarmed attack," while others (like the Magus's Spellstrike) specify you must "make a melee Strike with a weapon or unarmed attack." These appear to be interchangeable.
In a similar case, the cantrip Produce Flame has a melee and ranged use. You select whether the cantrip will act as a melee or ranged spell attack when you cast it.