Ender 5 hotend and bed cooling down while auto bed leveling
For Marlin firmware, you should check the setting PROBING_HEATERS_OFF in Configuration.h file:
//#define PROBING_HEATERS_OFF       // Turn heaters off when probing
#if ENABLED(PROBING_HEATERS_OFF)
  //#define WAIT_FOR_BED_HEATER     // Wait for bed to heat back up between probes (to improve accuracy)
#endif
//#define PROBING_FANS_OFF          // Turn fans off when probing
//#define PROBING_STEPPERS_OFF      // Turn steppers off (unless needed to hold position) when probing
//#define DELAY_BEFORE_PROBING 200  // (ms) To prevent vibrations from triggering piezo sensors

It is probably enabled in your case. You may want to switch this off and reinstall firmware to maintain constant heating during probing.
However, you may want to take into account possibility of electrical or magnetic intereferences during probing from heaters and their circuits. Disabling them for a while may eliminate these influences and give more reliable measurements. Unless the bed ot hotend are unable to maintain stable temperature for a while and cool down too much (e.g. bed changing shape). So may want to experiment what works the best in your case, maybe including other settings listed in given section.