Fun fact: if you happen to create a custom post type and because you’ve done it a hundred times, you do it without consulting the documentation and you conveniently forget that their name absolutely can’t ever be longer than 20 characters, you’re in for a surprise. Because in the beginning everything seems to work well, up until you try to save a new post. wp_insert_post
will just silently fail, with a WP_Error
without any further information.
So basically there are two ways to make sure that doesn’t happen again: You either remember to pick a short name (which might mess with prefixing) or you just don’t use WordPress.