I have discovered the reason why when using the bundled executable my web browser doesn’t load properly, it is due to a check performed in streamlit to establish whether streamlit was properly installed. Basically everytime streamlit is run, at some time the following is executed in config.py:
@_create_option("global.developmentMode", visibility="hidden", type_=bool)
    def _global_development_mode():
        """Are we in development mode.

        This option defaults to True if and only if Streamlit wasn't installed
        normally.
        """
        return (
            not util.is_pex()
            and "site-packages" not in __file__
            and "dist-packages" not in __file__
        )

This is called from Report.py which has the effect of setting the port to 3000:
def _get_browser_address_bar_port():
    """Get the report URL that will be shown in the browser's address bar.

    That is, this is the port where static assets will be served from. In dev,
    this is different from the URL that will be used to connect to the
    server-browser websocket.

    """
    if config.get_option("global.developmentMode") and config.get_option(
        "global.useNode"
    ):
        return 3000
    return config.get_option("browser.serverPort")

This call works normally when using either streamlit run pythonScript.py or python streamlitWrapper.py but (for whatever reason), once pyinstaller bundles streamlit into the executable, the above check fails and sends streamlit into development mode, and things stop working as expected. This is obviously the wrong behaviour on streamlit’s part, pyinstaller has almost certainly bundled everything correctly but streamlit is looking in the wrong place to check if it has been installed correctly. What do I need to modify to ensure that streamlit is satisfied that it has been properly installed when running from an executable? I get the feeling that modifying def _global_development_mode(): to always return True is probably a dangerous idea.