They landed a lot of falcon 9 first stages without legs on the water, vertically, to test the control system. And a number of attempted barge landings with legs failed, before the first successful landing. Now it's almost a routine thing.
The early starhopper/starship flights proved what they needed to that they'd generally land on target.