Suppose two planets A & B, with B moving away from A at velocity v.
A spaceship departs from A in the direction of B at velocity v (putting it in the same inertial frame as B), and remains that way for some arbitrary amount of time until turning around and returning.
From A's perspective, the spaceship has been travelling at v, then applied a negative thrust equivalent to 2v thereby decelerating to 0 at the turnaround point, and reversing towards A at speed v until arriving back at A. Thus both legs of the trip have been done with speed v, and the time dilation on both legs should be equivalent.
However, from the perspective of B, the spaceship had an initial velocity of v before even taking off, and after takeoff had decelerated to 0, stayed that way for some amount of time, then accelerated towards A at velocity 2v. Thus on the first leg of the trip no time dilation should have occurred, and on the second leg, the spaceship should experience double the time dilation that A assumed.
If the spaceship recorded time elapsed on its clock on the first leg, and the second leg, will the times differ or not?
Where has my analysis gone wrong?
Note: Let's leave the moment of acceleration/deceleration out the picture. The question could equally have been posed using other travelers (like the Three Brothers version) to avoid acceleration.