Since 2025.2.0, I got the same issue. Though I have found it is related to tables that I have deleted. My solution was that I restored the tables and did not generate them anymore. That solved my issue. Your issue might be different, but that was my experience.
Do not mix old scripts generated by previous versions with new scripts generated by the latest version, you may delete all files from the project folder before generating new files.