exec /usr/local/bin/python3: exec format error

I am getting the following logs when i tail into balena:

[Logs]    [2024-04-26T07:47:45.050Z] [main] exec /usr/local/bin/python3: exec format error
[Logs]    [2024-04-26T07:47:54.066Z] [main] exec /usr/local/bin/python3: exec format error
[Logs]    [2024-04-26T07:48:08.789Z] [main] exec /usr/local/bin/python3: exec format error
[Logs]    [2024-04-26T07:48:35.759Z] [main] exec /usr/local/bin/python3: exec format error
[Logs]    [2024-04-26T07:49:29.003Z] Restarting service 'main sha256:d8e0121f939c001f738f28679191ad6f05ce6bd2653f70d2bca464bf040f3042'
[Logs]    [2024-04-26T07:49:29.019Z] Service exited 'main sha256:d8e0121f939c001f738f28679191ad6f05ce6bd2653f70d2bca464bf040f3042'

My Dockerfile:

FROM balenalib/%%BALENA_ARCH%%-debian-python:3.10-bullseye-build as b1
RUN [ "cross-build-start" ]
ENV UDEV=1
ENV DEBIAN_FRONTEND=noninteractive
RUN install_packages git gcc python3-dev
RUN pip3 install --upgrade pip
COPY requirements.txt .
COPY setup.py .
RUN pip3 install .
RUN pip3 cache purge
RUN [ "cross-build-end" ]

FROM balenalib/%%BALENA_ARCH%%-debian-python:3.10-bullseye-run
WORKDIR /app/
ENV UDEV=1
RUN [ "cross-build-start" ]
RUN install_packages gcc
COPY --from=b1 /usr/local/lib/ /usr/local/lib/
COPY --from=b1 /lib/ /lib/
ENV LD_LIBRARY_PATH="/lib/:${LD_LIBRARY_PATH}"
ENV PATH="/lib/:${PATH}"
ENV PATH="/usr/local/lib/python3.10/site-packages:${PATH}"
RUN [ "cross-build-end" ]
COPY . .

CMD ["/bin/bash", "start.sh"]

I am working on a x86_64 machine and want to build image for arm64 machine, that is the reason i used ‘cross-build-start’ and ‘cross-build-end’.