That's odd. Are those spring forks, or air? Can you make a warranty claim? Or buy a replacement from them?
The most challenging thing in fork replacement is spec'ing a replacement that fits, then it would be cutting the steerer tube to length. A front motor complicates the process. A lot of if ands or buts to that.
Best to buy a drop in replacement from the bike's manufacturer. But why did it fail? If you take it apart to find out the why, maybe you can figure out how to fix it.