I am having the same issue, but it occurred after upgrading to Moodle 4.02. When trying to view H5P content , an error message is displayed, but only when logged-in as Admin (although edit function for H5P content is still visible and accessible). When logged in as a student user, l can see the H5P content no problem (a good thing!), without generating this error message:

Debug info:
Error code: codingerror
Stack trace:
- line 1221 of /lib/pagelib.php: coding_exception thrown
- line 4806 of /lib/navigationlib.php: call to moodle_page->set_cm()
- line 4342 of /lib/navigationlib.php: call to settings_navigation->load_module_settings()
- line 833 of /lib/pagelib.php: call to settings_navigation->initialise()
- line 957 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
- line 135 of /blocks/settings/block_settings.php: call to moodle_page->__get()
- line 341 of /blocks/moodleblock.class.php: call to block_settings->get_content()
- line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
- line 1222 of /lib/blocklib.php: call to block_base->get_content_for_output()
- line 1280 of /lib/blocklib.php: call to block_manager->create_block_contents()
- line 377 of /lib/blocklib.php: call to block_manager->ensure_content_created()
- line 4086 of /lib/outputrenderers.php: call to block_manager->region_has_content()
- line 28 of /theme/remui/layout/embedded.php: call to core_renderer->blocks()
- line 1473 of /lib/outputrenderers.php: call to include()
- line 1399 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
- line 69 of /h5p/embed.php: call to core_renderer->header()
I would appreciate any help as well.