Utter_custom_json() seem not working and quick replies in custom actions

I am having a custom action like this:

class MyAction(Action):
    def name(self) -> Text:
        return "my_action"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict[Text, Any]]:

        message = {
            "text": "Hello",
            "quick_replies": [
                {
                    "content_type": "text",
                    "title": "Hi",
                    "payload": "/affirm",
                },
                {
                    "content_type": "text",
                    "title": "Goodbye",
                    "payload": "/deny",
                },
            ],
        }
        dispatcher.utter_custom_json(message)
        return []

I ran the chatbot on a html webpage. When the action is run, the widget suddenly disappear and this message come out from browser:

Uncaught TypeError: Cannot read properties of undefined (reading 'image')
    at rh (rasa-chat:2:763681)
    at rasa-chat:2:765020
    at aa (rasa-chat:2:79647)
    at sa (rasa-chat:2:80101)
    at Object.useState (rasa-chat:2:85997)
    at t.useState (rasa-chat:2:336049)
    at ah (rasa-chat:2:764396)
    at ra (rasa-chat:2:78873)
    at Ba (rasa-chat:2:88391)
    at Vs (rasa-chat:2:132052)

I also tried with dispatcher.utter_message(json_message=message) but it didnot work either. So, is there something wrong with it and how to fix?

By the way, is that the right way to define quick replies in custom action, and will the quick_replies defined in custom actions appear in webpage widget?

I am using Rasa 2.x

Thanks a lot!!