The aircraft is one of the 29 P-38 built (the very first production model - note the serial 40-751). So it predates the arrival of the DUKW in service.
So it looks like some kind of trial about getting aircraft from ship to shore. Seemingly one of a series with some aircraft having the outer wings removed. But where & when?
Yes, it seems the DUKW Transport way was used when a cargo ship couldn't enter a harbour or there wasn't any embarcadero around. The PTO was a good area with the islands surrounded with the coral reef or shoals. In the way a plane could be delevered to a cargo ship and lifted up with a crane or sent to a land.