I can take 2 edges bisector angle value with middle = (theta1+theta2)/2, but I dont know how to calculate rotation value that direction is always outwards from the corner. I need rotation value for rotating object from its 0,0,0 rotation.
Sometimes rotation is right and sometimes opposite, depending of the angle.
So in shortly, object -Y direction is always facing away from the corner.
I do not know if you got it right but, from what I can see in the images, you can take the vector bisect between these edges and use the function to_track_quat: