I'm pretty sure it calculates the actual distance to the speaker, Not to the wall. I've never had YPAO be that far off on distance. Possibly a reflection?
I usually run the full YPAO once, mainly to check for out of phase, then adjust the distance and size manually, and run it again with phase, distance, and size turned off.