We present the strain and temperature dependence of an anomalous nematic phase in optimally doped BaFe$_2$(As,P)$_2$. Polarized ultrafast optical measurements reveal broken 4-fold rotational symmetry in a temperature range above $T_c$ in which bulk probes do not detect a phase transition. Using ultrafast microscopy, we find that the magnitude and sign of this nematicity vary on a ${50{-}100}~mu$m length scale, and the temperature at which it onsets ranges from 40 K near a domain boundary to 60 K deep within a domain. Scanning Laue microdiffraction maps of local strain at room temperature indicate that the nematic order appears most strongly in regions of weak, isotropic strain. These results indicate that nematic order arises in a genuine phase transition rather than by enhancement of local anisotropy by a strong nematic susceptibility. We interpret our results in the context of a proposed surface nematic phase.