If you are building on arm64 and deploying in amd64, there is no way in passing a platform directive to the underlying _helper function, as all commands and envs passed to custom_build_with_restart are stripped out before _help calls the docker_build command.
End result is the helper image cannot be compiled, because there is platform incompatibility between it and the base image.