Engine replaced under warranty

Looking to purchase a 2021 hyundai palisade.


Car fax is clean buts states the engine was replaced under warranty.

Got a prepurchase inspection. Came back good



Would this be a safe buy?