You should definitely have a look at those logic hooks:
Sun Oct 6 13:57:47 2019 [167023][1][DEBUG] Creating new instance of hook class KPI_Hooks without parameters
Sun Oct 6 13:57:47 2019 [167023][1][DEBUG] Creating new instance of hook class SugarChimp_LogicHook without parameters
Sun Oct 6 13:57:47 2019 [167023][1][INFO] Query:INSERT INTO opportunities_cstm (id_c
,closed_won_date_c ,division_c ,closed_won_check_c ,needs_identified_date_c
,meeting_booked_check_c ,closed_lost_date_c ,activity_so_far_c
,proposal_sent_check_c ,needs_identified_check_c ,service_type_c
,csa_sent_check_c ,clear_amount_c ,reason_for_recruitment_c ,no_of_positions_c
,meeting_booked_date_c ,total_billing_amount_c ,previously_outsourced_c
,closed_lost_check_c ,will_outsource_c ,csa_sent_date_c ,needs_position_filled_by_c
,jjwg_maps_lng_c ,issues_faced_c ,billing_amount_c ,jjwg_maps_lat_c
,solution_presented_check_c ,proposal_date_c ,solution_presented_date_c ) VALUES
('95b6f286-c880-f1e5-c74b-5d9a2b7000fd' ,NULL ,'Performance' ,'0' ,NULL ,'0' ,NULL ,'no
info' ,'0' ,'0' ,'^Executive Recruitment^' ,'0' ,0 ,'Succession Planning' ,NULL ,NULL ,0 ,'No' ,'0'
,'Yes' ,NULL ,NULL ,0 ,'no info' ,0 ,0 ,'0' ,NULL ,NULL )
Sun Oct 6 13:57:47 2019 [167023][1][FATAL] Mysqli_query failed.
Sun Oct 6 13:57:47 2019 [167023][1][INFO] Query Execution Time:0.00034594535827637
Sun Oct 6 13:57:47 2019 [167023][1][FATAL] Query Failed: INSERT INTO
opportunities_cstm (id_c ,closed_won_date_c ,division_c ,closed_won_check_c
,needs_identified_date_c ,meeting_booked_check_c ,closed_lost_date_c
,activity_so_far_c ,proposal_sent_check_c ,needs_identified_check_c ,service_type_c
,csa_sent_check_c ,clear_amount_c ,reason_for_recruitment_c ,no_of_positions_c
,meeting_booked_date_c ,total_billing_amount_c ,previously_outsourced_c,closed_lost_check_c ,will_outsource_c ,csa_sent_date_c ,needs_position_filled_by_c
,jjwg_maps_lng_c ,issues_faced_c ,billing_amount_c ,jjwg_maps_lat_c
,solution_presented_check_c ,proposal_date_c ,solution_presented_date_c ) VALUES
('95b6f286-c880-f1e5-c74b-5d9a2b7000fd' ,NULL ,'Performance' ,'0' ,NULL ,'0' ,NULL ,'no
info' ,'0' ,'0' ,'^Executive Recruitment^' ,'0' ,0 ,'Succession Planning' ,NULL ,NULL ,0 ,'No' ,'0'
,'Yes' ,NULL ,NULL ,0 ,'no info' ,0 ,0 ,'0' ,NULL ,NULL ): MySQL error 1062: Duplicate entry
'95b6f286-c880-f1e5-c74b-5d9a2b7000fd' for key 'PRIMARY'
Just as I thought, the code is first saving the Opportunity custom fields, and then fails when it tries to save the second time, with the same id as before. that second either should not exist, or it should be an UPDATE, instead of an INSERT.
I don’t think that core code would save just to the custom table, without saving the main table. I don’t know where your hooks are defined, but they shouldn’t be too hard to find, under “custom” dir.