Order is important…
Set the end-positions first:
Then set the handles:
…forcing handle positions to the curve positions, offset by closest normals. Scaling the handles by curve length here. (There is an issue in 3.2 where capturing curve lengths resets handle types so you need to do that after the capture for it to work (can capture in point or spline domain; makes no difference))
Good luck!