Those outdoor pictures are what I was wanting to see.
It looks like your only problem is with the flash unit.
It does not reliably flash when it should.
Just as a final possibility, ready the camera as if you were going to take a flash pictures and have someone watch and see your hand placement on the camera.
Make sure that no part of your hand is covering the flash unit or the Auto Focus assist light on the front of the camera.
If that checks out OK it is time to see about service or replacing.
Service usually will cost over $100.
The camera can still be used for "non flash" pictures.