Mhmm I see. The problem is that shake/punch animations become fixed after startup (because they store an array of Vector3 points, in order to make them shake but with some "harmony"). It's working via API for you because I suppose you're recreating the tween instead of restarting the same one.
For your use case, I would actually recommend to use the code and recreate the tween each time.