We investigate the electronic and structural changes at the nanoscale in vanadium dioxide (VO2) in the vicinity of its thermally driven phase transition. Both electronic and structural changes exhibit phase coexistence leading to percolation. In addition, we observe a dichotomy between the local electronic and structural transitions. Nanoscale x-ray diffraction reveals local, non-monotonic switching of the lattice structure, a phenomenon that is not seen in the electronic insulator-to-metal transition mapped by near-field infrared microscopy.