Do you have a picture of the breaker that trips?
Do you have a picture of the pump wiring at the back of the motor?
Did the electrician measure the amps the pump was pulling to make sure that they did not exceed the breaker amp rating?
A good electrician should be able to tell you why a breaker is tripping. It's kind of their job.
Note that the breaker might be tripping due to a ground fault or an excessive amp draw.
Current in excess of 100% but less than 135% can take hours to trip. It's a common misconception that breakers trip immediately if the current gets to the breaker amp rating.
Breakers only trip immediately if there is a direct short or ground fault.
A breaker up to 30 amps doesn't have to trip until it gets to 135% of the rated current. Even then, it can take up to an hour to trip.
At 200% of rated current, the trip time has to be less than 120 seconds.
At 100%, the breaker should not trip.
At 101% to 134%, the breaker might or might not trip depending on how much heat is generated in the breaker.
If it does trip, there is no set time that it's required to do. It might take hours.
https://goodsonengineering.com/wp-content/uploads/2017/08/CircuitBreakerMyths_web.pdf
Based on a trip time of hours, I would suspect a bad breaker, an overloaded breaker at 101% to 134% of the breaker amp rating or an intermittent ground fault.
The electrician should check the volts and amps at the motor, that the volts match the pump voltage setting and that the amps don't exceed the motor label amps or breaker rated ampacity.
The electrician should check for any ground faults.