How to calculate quaternion from world position of 3 points on a plane

If you have three points, you can easily determine three basis vectors using the cross product.
From the base you calculate the quaternion.

See also from the Collection of examples from discourse.threejs.org
https://hofk.de/main/discourse.threejs/2021/CarRacing/FlightRouteQuaternion.html

Maybe you can get further with this?