Need help with Sending chat message from extension

That won’t work as the frontend JWT’s do not have permission

You need a JWT Signed with the “external” role.

Signed JWT created by an Extension Backend Service (EBS), following the requirements documented in Signing the JWT. A signed JWT must include the role and channel_id fields documented in JWT Schema. role must be set to "external" and channel_id must match the broadcaster ID in the request URL.

The token you are using isn’t valid for this call