Gutenberg consume wp-json data and reflect in frontend the content

What you are building is called ‘Dynamic Block‘ and Your block will not work because you haven’t added the front end code ( which is the PHP part for dynamic block ). See this official block code there’s PHP part as well to save the block and work on the front end.

Here’s the official explanation –

Because it is a dynamic block it also needs a server component. The
rendering can be added using the render_callback property when using
the register_block_type function.

Although you can use ServerSideRender component but it’s not recommended.