That’s not actually a very odd path when a ship is waiting for a pilot (required for transit of most canals definitely the Suez and some straits), and likely tugs, to become available.
A ship will have their transit scheduled before hand, approach, and then have to wait for a pilot and tugs to become available (on their schedule often) before they can begin their approach to transit. While they are waiting they do circles or will even approach nearby areas that allow smaller boats to approach to sell their wares. Based on the track it looks like they may have arrived a bit earlier then planned.
I was thinking it was some kind of hold pattern, like circling a busy airport, waiting for your turn in the queue. I guess having a specialist pilot running things would be very helpful in such a situation too.