Captcha field was failing to render , was wrapped in editor html, the onInit, and onDisplay was causing this.
shopfunctionsF
comment these out
// $app = JFactory::getApplication();
// $results = $app->triggerEvent('onInit', [$id]);
// $output = $app->triggerEvent('onDisplay', [$reCaptchaName, $id, 'g-recaptcha required']);
and added
$captcha = \Joomla\CMS\Captcha\Captcha::getInstance($reCaptchaName);
$output = [$captcha->display($id, $id, 'g-recaptcha required')];
so fixed as so
} else {
// $app = JFactory::getApplication();
// $results = $app->triggerEvent('onInit', [$id]);
// $output = $app->triggerEvent('onDisplay', [$reCaptchaName, $id, 'g-recaptcha required']);
$captcha = \Joomla\CMS\Captcha\Captcha::getInstance($reCaptchaName);
$output = [$captcha->display($id, $id, 'g-recaptcha required')];
}