This looks like a world generation registry issue rather than a datapack problem. Since the world loads initially but fails after saving, I'd suspect a biome or dimension mod writing invalid registry data. If you can upload your latest.log and mod list, I can help narrow it down. If you'd rather have someone diagnose it directly, feel free to message me.