All other things being equal, if you fly to that fixed point via a longer path then it will take the aircraft longer to get there, and it may (see below) have used more battery when it does get there. So it would then hover for less time before smart RTH is activated. But that doesn't mean that the total flight time will be the same because those differences will not necessarily cancel.
If you consider the battery to contain a fixed available amount of energy, and use the simple (and not correct, but bear with me) assumption that power (rate of energy use) goes up with tilt (and therefore airspeed) because the motors are working harder, then total flight time available would be maximum if you take off and hover, and then decrease from that with any lateral flight. The more time spent with tilt, the quicker the battery is depleted.
So in your example, more energy is expended getting to the fixed point via the longer route, less time, and therefore less energy, is expended in the hover, and the same energy is expended returning to home. And since the rate of energy use is higher while flying than while hovering, total energy will be the same but total time will be less.
Back to the assumption about rate of energy use - it's wrong because it ignores aerodynamic lift, and so minimum power (rate of energy use) actually occurs at non-zero airspeed. That's the reason for these specifications for the
Mavic 2:
Max Flight Time (no wind) 31 minutes (at a consistent 25 kph)
Max Hovering Time (no wind) 29 minutes
Max Flight Distance (no wind) 18 km (at a consistent 50 kph)
Assuming that DJI did their testing correctly, minimum power occurs at an airspeed of 25 km/hr, and yields 2 additional minutes of flight time over hovering.
So in fact it is possible that the longer route, if flown with a
Mavic 2 at 25 km/hr, will actually yield a longer total flight time than the shorter route, because more time will be spent in the minimum power state.