OK pardon my ignorance on this subject. I mistakenly thought "focal length" was literally the distance between the camera and the subject being focused on, but I see (as a bell rings) that it's the distance between the lens and the sensor. What I was really referring to was focal *distance* - the distance between the camera and the subject being focused on. I guess that's not in the metadata (?) - at least I don't see that listed. However I think can be calculated from the other data - e.g. ApertureValue and such (?).
Not sure if you know much about such things, but here's a comparison of the meta-data for good vs bad:
Good (taken in auto mode):
https://drive.google.com/open?id=1WOkg2EiyNJWjlkqP9LAbswosb2aqbVM2
Bad (taken in pro mode - "inifinite" focus):
https://drive.google.com/open?id=1Z0MSsdV_SyycbfvgTmVfrxpufeSVr2eu
I'll play around with it some later to see how the different settings work, and see if I can get Pro mode to as-close-as-possible approximate the auto mode settings, to try to figure out what the "x factor" is.
What sticks out most to me between those two data sets is the aperture value. The good one had a smaller aperture value than the bad. They labeled things a bit odd, so I'll give a little explanation in case it's not clear for you.
Aperture is how "open" the lens is. The larger the opening, the more light is let in, which is great for low light photography and why you see phones advertised with wide apertures. The aperture is defined as an f-stop number, and is an inverse ratio of focal length to aperture diameter. So in the good example, your aperture is 1:2.52. In common vernacular, it would be labeled f2.52 (because it's always 1/x, thus the 1 is understood as constant), or sometimes just 2.52 as in your examples. The larger the number, the smaller the diameter of the opening.
For a typical phone user, this doesn't matter because most phones have a fixed aperture on the lenses. Yours happens to have a variable aperture, so is something to understand when using manual mode. The downside you should be aware of is that the aperture also plays a part in the depth of field. A wider aperture will have a more shallow DoF than a narrow aperture. When you focus on a spot, a certain amount of the scene in front and behind that spot will also be in focus. The wider the aperture, the less distance from the focal point will be in focus and vice versa. The further away you set the focus point, the larger the DoF, and vice versa again.
You may now see what I'm getting to. If possible, try again using the narrow aperture. I've seen complaints that Samsung will override manual settings in low light, so it may prevent you from switching the aperture. Try both at infinite focus and a step or two back from that as in my initial suggestion. Because this causes less light into the sensor, you will need to bump or the ISO, and/or increase the shutter time to compensate.
As for calculating the focal distance from the metadata, I've never seen that done. I doubt it is even possible, nor have I ever seen a photographer mention it when posting details of a photo. In full fledged cameras, the focus adjustment ring on the lens isn't even labeled with setting amounts.