Schedule Export problem

Hi all,

Can anyone tell me why this is not working?


I have exactly the same script for Revit 2017, 2018 & 2019 and they all work fine, but 2020 is giving issues and I don’t know what is wrong? I have tried exporting without a level and I get the same result.
Any help would be appreciated!
Thanks.