It baffles me since this features is not because of a limitation with WordPress but because a non-existing GeneratePress hook.
A theme can’t inject a hook to a pre-made widget block. Widget blocks are hard-coded by its developer so its rendered HTML structure is fixed.:) (the content is dynamic, taken from its text field but the structure is fixed)
While some have filter hooks, it’s usually something minor like changing the widget heading/title or its class selector.
Depending what you’re trying to do, I think it’s doing a template on Block Element and hooking it to a portable hook may be a good idea.
Check the portable_hook shortcode snippet provided here β
https://generatepress.com/forums/topic/hook-in-hook/#post-1636333
A wise man once said:
"Have you cleared your cache?"