Error was encountered while creating environment variables in the bash script. Where only one line had to be corrected to avoid using encoding the already encoded key.
PRIVATE_KEY=$(sed '1d;$d' refresh.key | tr -d '\n')
PUBLIC_KEY=$(sed '1d;$d' refresh.pub | tr -d '\n')