ERROR: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x91 in position 187: invalid start byt

Error

I was following this tutorial to set up metabase integration on my erpnext v13.6.0 instance.

Further details on the setup:
image

Python script:

import jwt
import time

METABASE_SITE_URL = "http://167.71.40.107:3000"
METABASE_SECRET_KEY = "4ccf05683a65d80763c06283c0dabf020e0aa1aec6c91e8c9b60c483d28ab28f"

payload = {
  "resource": {"dashboard": 1},
  "params": {
    
  },
  "exp": round(time.time()) + (60 * 10) # 10 minute expiration
}
token = jwt.encode(payload, METABASE_SECRET_KEY, algorithm="HS256")

iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token.decode("utf8") + "#bordered=true&titled=true"