Probably a bug in your custom action code. I’d add some console logs in different parts of your code to see where it goes wrong.
If your custom action takes arguments (args) and your input is not formatted in a way that is expected then it already goes wrong there.