The kubebuilder documentation on finalizers has the following example code for removing a finalizer from an object.

ci}ofnrteerrrmoreoltvl:uee=rrnourut.criUtlprf.dliRa.netRameelo(sivcuzetleFxtri,{n}fac,rlroioemznreJrtroh(bec)r;loinesJrtorba,!n=dmynuFipildnaa{tleizietr.Name)

I found when doing this, if the operation running above this in the Reconcile() function (typically to remove a remote resource from an API) this r.Update() call would return an error like this:

the object has been modified; please apply your changes to the latest version and try again

This can leave your object stuck in a Terminating state which can cause issues like Namespaces and other objects not be cleaned up correctly.

There are a few ways you could go about mitigating this issue, but using Patch() appears to be the fastest and most consistent approach.

ff}oi}:rfppri}r=a.freie:tLemn,=coetos=hgruv.e=[.rreG]:Ine:ub=n:ot=tyf=cuFitcotrirlel(rrnas(i".lfan.ferP.ilgBmneaRnieattmteazy..ocslefFSRvhuiripai(lzs{nrwncte(aiPgt{r)lnax}ittf,,fzfcire(hnneor`(asrmA[tl,rw{yits"pzphAoeeaecpsrtc".clo:JfhiuSr)sn"Oo;ttrNmePea{manrnotardvcmehe!u"Ts=p,ypdpana"ecitp,elea"tp){ih)t".:"/metadata/finalizers/%d"}]`,i))