For power off I think it would be a good idea to move that in a @func like in start here and call it with a delay, so server can finish and after being finished storing everything etc. it gets shut down with a delay. Also helps head cooling faster when fan is on. Some printers control it by temperature to prevent heat rising when hot.But I still wonder what @execute does different as I assume it just switches off power in a script and exits.
See with eye symbol what the error message for failed is. Maybe it is the ffmpeg that is having issues especially if I see it starts converting.
I think it is normal depending on your firmware config to handle M600 that way. It can be handled inside firmware or in server but server has to know. M412 just tells marlin to do that. For a while we had this even in our connect code, but that caused issues with some firmware configs so you need to add it in connect script to handle it in server.
#2 server does what you write. You can also add a move to side or raise z (@moverel Z5 F600) or retract filament a bit aside. That is up to you. I assume M600 triggers end of filament handling blocking server until finished. How depends on current active settings.