My approach is to use $objectToArray and then $filter to remove the field. The dotted field names then become a value which is easier to manipulate. You will find this approach on Mongo playground.
Note, that I do everything in multiple stage as this is easier to develop and understand. You may of course put everything in an unreadable stage. I use temporary values in a _tmp object as to see what each steps perform. I left out a clean up state that $unset this _tmp object for readability of the playground.
As @steevej suggested, you can use aggregation pipeline to express update. You can also use aggregation expressions in filter portion of update by wrapping it in $expr.
If you’re on MongoDB version 5.0+, check out aggregation expressions $getFiled, $setField, $unsetField for working with field names containing dots or leading $.