I am a bit unsure if my calculations are correct, but on my scribbling paper it seemed to work out.
P1 and P2 lie on a circle around M.
This allows us to measure the distance of the two points by just taking the radius (which is half the line length) of the circle and constructing two rectangular triangles. The accepted answer here provides a sketch for this construction.
So given your rotation angle is $\gamma$ and the line is $l$ long it follows:
$x = 2* sin(\frac{\gamma}{2}) * \frac{l}{2}$
The lines M to P1 and M to P2 form a isosceles triangle with the third side being the line segment between P1 and P2.
The angle at point M is known to be the rotation angle $\gamma$ so the remaining two angles in this triangle are given by
$\alpha = \frac{180 - \gamma}{2}$
And therefore the angle between the wrong line and the needed translation vector is just
$\beta = \alpha + \gamma$
So now you rotate a unit vector that starts along the wrong line.
You rotate it around P1 for $\beta$ and scale it to length x.
This yields the translation vector from P1 to P2. The rotation of the line should indeed be correct.