Hi Jan,
I encountered the same issue with the initramfs-overlay-hook.
I tested your patch successfully on the qemu-arm64 machine.
 
Thanks for the fix!
 
David