Why did the flight Osaka -> Frankfurt circle above the airport after taking off from Osaka International?
Looking at FlightAware, we see this takeoff for your flight:



Examining some airport charts for KIX, this looks like the standard departure NANKO REVERSAL THREE DEPARTURE from runway 06R.



I guess that the loop is to give the aircraft enough time to climb to 8000 before it reaches NANKO. And, I guess the 8000 feet is for either terrain or noise abatement (notice the climbing loop is entirely over water.)