@omtek
I've some macro going on for my klicky to unload/load it. I'll post the macro's maybe they can help you out to atleast prevent the crashes from happening.
I must admit I didn't read through all your macro files and I'm not on 3.5 yet so not sure if it will be of any help or not but still figured I'd post them in an attempt to help out.
All of these files are in their own directory called ZProbe
initialize.g
if global.probe_type == 0 ; Set config values for the BLTouch
M98 P"/macros/ZProbe/BLTouch/initialize.g"
elif global.probe_type == 1 ; Set the config values for the Klicky probe
M98 P"/macros/ZProbe/Klicky/initialize.g"
deploy_probe.g
; Command to deploy the probe for Z moves that require probing
if global.probe_type == 0 ; Deploy probe for BLTouch
M98 P"/macros/ZProbe/BLTouch/deployprobe.g"
if global.probe_type == 1 ; Deploy probe for Klicky
M98 P"/macros/ZProbe/Klicky/deployprobe.g"
retract_probe.g
; Command to retract the probe
if global.probe_type == 0 ; Retract the probe for the BLTouch
M98 P"/macros/ZProbe/BLTouch/retractprobe.g"
if global.probe_type == 1 ; Retract the probe for Klicky
M98 P"/macros/ZProbe/Klicky/retractprobe.g"
as you can see I use this to be able to switch between probes (I once had the idea to create RatRepFirmware but due to time constraints and to many projects I haven't really continued on it)
The specific klicky files:
initialize.g
; Setup the probe details for the Klicky probe
M558 P8 C"121.io0.in" I1 H2 R0.1 F240:60 T8000 A5 S0.01 ; set Z probe type to unmodulated and the dive height + speeds
G31 P25 X-24.526 Y-20.725 Z3.29 ; set Z probe trigger value, offset and trigger height, more Z means closer to the bed
deployprobe.g
; The deploy command for Z when using a dockable probe
if sensors.probes[0].value[0] != 0
var originX = {move.axes[0].machinePosition} ; Store the X position before grabbing the probe.
var originY = {move.axes[1].machinePosition} ; Store the Y position before grabbing the probe.
G1 X60 Y11.5 F9000 ; Move tool in front of dock
G1 X7.30000 Y11.5 F9000 ; Move tool in position where probe is mounted
G1 X60 Y11.5 F9000 ; Move tool in front of dock
if var.originX > 60 || var.originY > 11.5
; Move the toolhead back to the position we came from
G1 X{var.originX} Y{var.originY} F9000
M400
if sensors.probes[0].value[0] != 0
abort "Error probe not attached - aborting"
retractprobe.g
; The retract command for Z when using a dockable probe
if sensors.probes[0].value[0] != 1000
G90
G1 X60 Y11.5 F9000 ; Move tool in front of dock
M400
G1 X7.30000 Y11.5 F9000 ; Move tool in position where probe is mounted
G1 X7.30000 Y42 F9000 ; Move tool to detach probe
G1 X60 Y11.5 F9000 ; Move tool in front of dock
M400
if sensors.probes[0].value[0] != 1000
abort "Error probe not docked - aborting"
TLDR;
I'm manually taking care of the mounting/docking and make sure to check the state of the probe before continuing any movements
I also posted this macro to help determine the dock details and it'll generate most files for you afterwards
https://forum.duet3d.com/topic/30495/dockable-probe-configurator-macro?_=1713439239779