Tuning the hysteresis of a metal-insulator transition via lattice compatibility