@Eoin's snippet works perfectly other than it should be JFactory.
// Load the namespacing for Factory (the new way instead of JFactory)
// Load the module position
<?php echo JFactory::getApplication()->getDocument()->loadRenderer('modules')->render("logo"); ?>
Components aren't really meant to be rendered more than once per request. Your best bet would be to make separate requests. Wrapper component and module can be used to display the page using an iframe.
Or you can retrieve the page in PHP using HTTP library. There is Components Anywhere plugin which uses this method https://extensions.joomla.org/extension/...
I try to give just a short answer on this. We cannot say that there is an “equivalent” of your code snippet in Joomla 4 since Joomla has been handling errors with using core PHP Exceptions. And your code sample would get error in newer Joomla 3 also.
The old JError class were deprecated quite long time ago (at Joomla 3.1). The code editors shows this ...
The ideal way is to have dependencies injected into your objects. Event dispatcher is registered with the global service container so you can fetch it when registering your component services in provider.php. However, there isn't a good way to pass it down to MVC elements without a custom MVC factory. Core components don't use anything like that yet.
Use the fully qualified class name which is Joomla\CMS\Helper\ModuleHelper.
To get this information in your IDE, you can run build/stubGenerator.php script via PHP command line. This will generate a stub file of deprecated class aliases and the new classes to use. This is how it looks in VS code: