Could you attach a simple project reproducing the error? I tried your script with a custom mesh and see it working in my own project.
Could you attach a simple project reproducing the error? I tried your script with a custom mesh and see it working in my own project.