lua/api: fix object constructors to fail gracefully

6 jobs for luaconstructorsfix in 1 minute and 49 seconds (queued for 23 seconds)
Status Name Job ID Coverage
  Container
passed container_fedora #13682919

00:00:23

passed container_ubuntu #13682920

00:00:37

 
  Build
passed build_on_fedora_no_docs #13682922

00:01:02

passed build_on_fedora_with_docs #13682921

00:01:11

passed build_on_ubuntu_no_gir #13682924

00:00:41

passed build_on_ubuntu_with_gir #13682923

00:01:02