Z axis no longer working on a working printer
It could be caused by software or configuration issue.
Possibility 1: just worked after re-installation of Marlin
You could have Z steps/mm set to 0 in EEPROM, and did not notice that fact.
It is possible to fix this unconsciously with Marlin software reinstallation, following the upgrade procedure which included reset of EEPROM settings - like &quot;Step 4: Finishing touches&quot; described in community wiki's guide for Updating Marlin Firmware. This is described in more details in another post No stepper motor movement on Ender 3 Pro.
Possibility 2: Marlin configuration is not correct
When you recompiled Marlin, did you use already proven configuration for Marlin? When saying &quot;Motors will not turn&quot; you mean only Z? Are your other motors are still functional now after Marlin was deployed?
Among other Marlin settings, you may want to check that this line is disabled in Configuration_adv.h:
  /**
   * Software enable
   *
   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
   * function through a communication line such as SPI or UART.
   */
  //#define SOFTWARE_DRIVER_ENABLE

(I took this advice from No Motor Power With TMC2209 on RepRap forum.)