Hi,
So far I can only spot that you are using $URLPART2 in the definition of ORIGINAL_STRING before it is filled in with values (so URLPART2 is empty at this time). If is shall be empty, omit it, if it shall be populated, use it once it is populated. But I am not sure if that even relates to the issue you are facing.
local ORIGINAL_STRING="${TIMESTAMP}${BYBITApiKey}${URLPART2}"