Weird servo gripper behaviour

Hello,
for my current project i need a servo gripper. I have build a strong gripper using some 3d prints and a rc servo from Amazon.
I'm using a Esp32 and a breadboard 5V power supply.
The mechanical system seems to work just fine. However I have problems programming it.
My goals for the gripper:
-grip as hard on the object, object should be of varying size
-return to a "normal" position, which is the open position

Here's a video of it using the code i wrote: https://youtube.com/shorts/QC1ttSWhqTU?feature=share

And here's the code:

#include <ESP32Servo.h>

Servo gripperServo;  // Create a Servo object

const int gripperPin = 25;       // Pin connected to the servo signal wire
const int openAngle = -250;         // Angle to fully open the gripper
const int closeAngle = 10;      // Angle to fully close the gripper
const int holdTime = 2000;       // Time in milliseconds to hold the position
const int minPulseWidth = 500;   // Minimum pulse width in microseconds
const int maxPulseWidth = 2500;  // Maximum pulse width in microseconds
int pos;

// Define min and max pulse widths

void setup() {
  // Attach the servo on pin 13 to the servo object with min and max pulse widths
  gripperServo.attach(gripperPin, minPulseWidth, maxPulseWidth);
  gripperServo.write(0);
}

void loop() {
  // Open the gripper as far as possible and hold for a few seconds
  gripperServo.write(openAngle);
  delay(holdTime);

  // Close the gripper as far as possible and hold for a few seconds
  gripperServo.write(closeAngle);
  delay(holdTime);

  // Repeat the cycle
}

Does anyone have an idea on how to tackle my problem and help me?
Thanks

aren't the argument to write() pulse widths from 500 to 2500, not angles

Ok, should i then map the angles to the pulse width?

yes

The servo library write function takes angles. If you use values larger than 500 then it will take them as pulse widths.

Using either is acceptable.

Here quoted from the link you provided. Did you read that before you posted it?

 void write () - Sets the servo angle in degrees; a value below 500 is
 treated as a value in degrees (0 to 180). These limit are enforced,
 i.e., values are treated as follows:
 Value                                   Becomes
 -----                                   -------
 < 0                                        0
 0 - 180                             value (treated as degrees)
 181 - 499                                 180
 500 - (min-1)                             min
 min-max (from attach or default)    value (treated as microseconds)
 (max+1) - 2500                            max

Thanks to all of you. Yeah, solved the problem. I just had to bring the servo to its 0° position and reassemble the gripper