Duplicate error when update column in the same table
It appears that WorkingShiftID is the primary key of the DutyRoster table, and that you're trying to set this to the same value in all rows:

UPDATE DutyRoster SET WorkingShiftID = workshfid;


Presumably, the problem is you forgot to include a WHERE clause in that statement, so the update could be restricted to a single row.