I mostly make this post to save myself some time next time I run into this issue. I run libreelec on a Raspberry Pi 4 attached to a tv that really just acts as a display, purely to play content from Jellyfin and YouTube. Every few months it will just seemingly randomly stop playing content from either Jelyfin and YouTube, usually at very inconvenient times. To diagnose this I enabled ssh. And started inspecting the kodi logs (which are located at ~/.kodi/temp/kodi.log btw), it would always look like the following.

ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
    Error Type: <class 'ValueError'>
    Error Contents: bad marshal data (invalid reference)
    Traceback (most recent call last):
        File "/storage/.kodi/addons/plugin.video.jellyfin/service.py", line 10, in <module>
        from jellyfin_kodi.entrypoint.service import Service
        File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/entrypoint/__init__.py", line 7, in <module>
        from ..jellyfin import Jellyfin
        File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/jellyfin/__init__.py", line 8, in <module>
        from .client import JellyfinClient
        File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/jellyfin/client.py", line 8, in <module>
        from . import api
        File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/jellyfin/api.py", line 6, in <module>
        import requests
        File "/storage/.kodi/addons/script.module.requests/lib/requests/__init__.py", line 43, in <module>
        import urllib3
        File "/storage/.kodi/addons/script.module.urllib3/lib/urllib3/__init__.py", line 11, in <module>
        from . import exceptions
        File "/storage/.kodi/addons/script.module.urllib3/lib/urllib3/exceptions.py", line 3, in <module>
        from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
        File "<frozen importlib._bootstrap>", line 991, in _find_and_load
        File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 779, in exec_module
        File "<frozen importlib._bootstrap_external>", line 911, in get_code
        File "<frozen importlib._bootstrap_external>", line 580, in _compile_bytecode
    ValueError: bad marshal data (invalid reference)
    -->End of Python script error report<--

Upon searching for a solution to this several posts suggest updating the apps or disabling auto update. I have however found a way easier solution to just get back up and running. Simply running find -name \*.pyc -delete to get rid of all the .pyc, which is a suggestion I found over on github.