Difficulties With OkPy in Revit 2025

Apologies for the late answer and thanks so much for sharing the solution here!
Indeed the CPython interpreter in 2025 uses pythonnet 2.5 which has it’s quirks. We’ll be moving to pythonnet 3 in next versions which will improve this.