The code I've shared above was adapted for brevity and to not share confidential data. It turns out I opened a pd.ExcelWriter
before calling the function and never closed it. Removing that line allows the code to save the workbook as expected. I still don't know why it raised no error, I would have noticed the issue much sooner.