That's an odd error indeed, however I have seen it happen on a few rare occasions. Those types of errors generally occur in the Reporting Module and they roughly mean that there is an entry that already exists in the SQL table(s) somewhere which is conflicting with the new data that has been entered. (in your case a new behaviour type).
The only people who would be able to fix this error and prevent it from happening again would be the devs at Capita!
Unfortunately in regard to restoring the lost data, the only way would be to manually enter it all in again. If I were in this situation, I'd create an attendance report to detail all of the marks recorded on that day which were not present marks, I'd then use the enter a code over a date range routine to mark the whole school present and then use edit marks to fill in the other marks.
As for other data such as behaviour & assessment, it's manual entry all the way.