Error showing while duplicating schedule

Can anyone tell me why this error is showing while duplicating schedule?

It might be due to View was deleted or something happened accidentally. Just restart dynamo and Run the Script again.

No view is not deleted and actual schedule is present but the duplicate schedule is not created so that filter is not applied. Can anyone give me the solution?

You can easily duplicate schedules by using @Konrad_K_Sobon archi-lab package: