How do I add recaptcha to a custom form programatically?
The module doesn't implement hook_element_info, so it doesn't define a new element type. The code you're using looks like it's borrowed from the traditional captcha module, which does things a bit better and provides the element type.

Looking at the code, this is all you need in your form alter hook:

g_add_captcha($form, $form_id);