It was a Python build issue. I figured it out — some C-extension modules (like for pickle) were not properly built, which caused the internal server error. After rebuilding the environment properly, the issue was resolved. Thank you!