They must abide by treaties, so no they don’t get to build relations with whoever they want. The canal’s handover came with requirements. If they don’t want to uphold those, and treaties mean nothing, why would their sovereignty be respected? But I do agree soft power is better and that the US government has poor strategy here and in general.
Also I’m not sure what you mean by “huge trade partner”. Panama isn’t even in the top 20 trade partners of the US.
You're somewhat mistaken with this assessment. The modern convention is that any treaty can be annulled simply by one of the parties declaring "what kind of idiot would have made this treaty".
It's worthwhile to stay informed on how modern global norms treat treaties.
Also I’m not sure what you mean by “huge trade partner”. Panama isn’t even in the top 20 trade partners of the US.