fixing chromosome with new contig
I have not received any answer to the question, so I created a small tool to fix the file myself.

I am assuming as per the question that there are perfect matches upstream and downstream to the new sequence, and that anything in between can be deleted/updated by the new sequence.

Given the first_n and last_n bases of the diagram in the question, and the entire patch sequence, we can create a single-line string of the reference with seqtk seq -l9999999 - and then edit it with the line below (in Perl regex):

$chromosome_str =~ s/$first_n.+$last_n/$patch/i


This creates the new string that can be used as the new fasta file.