Once in awhile I'll get an error when Time Machine is trying to run backups while my Mac is locked (problem goes away when it's not). Trying to find out why that happens has always been a bit of a pain but this command will help:
log show --predicate 'subsystem == "com.apple.TimeMachine"' --info | grep "Operation not permitted"
or more generally
log show --predicate 'subsystem == "com.apple.TimeMachine"' --info | grep error
The first command will show the files causing the Time Machine error.
Oddly giving full disk access to Time Machine doesn't fix this problem.
Also of note the couple of times I've recevied that error I had installed Goodnotes and it goes away if I uninstall it.
After finding out what file/folder is causing the problems it simply needs to be adding to the exclusion list in the Time Machine settings.