1. This sound command always worked for me. The crushing used to happen mid recording.
I'm confident the romlog you posted was somehow connected to the sound command. PT_PlaySound is in the stack trace.
However, it's possible for crashes to happen without generating a romlog, so it's possible the playsound related crash was from a different one. The romlog does have a datestamp in it, so you can tell if it's from a recent crash. The one you posted was "2020:05:03 13:00:14"
2. I always start in rec mode, moving to it manually.
You should probably not use set_record(true) if the camera is already in rec. Protect it with an if, like
if not get_mode() then
set_record(true)
end
3. When I keep only set_aflock(1) before shooting in autofocus mode this works. (If I want the camera to refocus before another recording should I use "set_aflock(0) sleep(400) set_aflock(1)" or just another "set_aflock(1)"?)
set_aflock behavior may vary between cameras , but I'd suggest set_aflock(0) before calling set_aflock(1) again. I suggested using the Canon keyboard shortcut because I'm not sure set_aflock does an AF scan on every camera. You can check by running it with the camera aimed at something that's not in focus.
4. So can I simply replace the half_shoot press/release procedure by "set_aflock(1) set_aelock(1)"?
Try it and observe whether the camera does what you want.
I've noticed two things - if I use set_focus() outside MF mode the camera crashes.
Do you have the camera in movie mode?
And somehow in extreme zoom set_focus(50) will result in get_focus()=100.
The minimum focus distance is larger at high zoom levels.