plugin development – Updating failed. The response is not a valid JSON response on my custom shortcode


Hi am building a plugin and I want to display a form using a shortcode but when I test it in the block editor I get an error

Updating failed. The response is not a valid JSON response.

When I check my out come on the page, The form gets displayed but not in the position where I created the shortcode.