The EXIF data shows the bright photo was at ISO 12,800 and the dark one at ISO 100.
In both cases shutter speed was 1/100 and aperture at f1.8 and in manual mode.
The dark photo is what I would expect to see if the flash didn't fire and the room was dimly lit. But it doesn't explain why the ISO is showing 100 if the Auto ISO is turned on. It's what I would expect if Auto ISO were turned off and ISO 100 were manually set and no flash.