I had the same issue with windows (11) security blocking python from writing files inside my OneDrive Documents folder. Had to override the setting.