This command, that doesn’t work anymore, was actually overwriting the entire document with {name:"Maxime"} which is what the replaceOne command is actually doing.
The actual command should be either
> db.coll.replaceOne({name:"Maxime"}, {surname: "Beugnet"})
OR
> db.coll.updateOne({name:"Maxime"}, {$set: {surname: "Beugnet"}})
So, to me, it’s normal and expected that the following command fails and raises an error.
At least this resolve the confusion between the 2 commands and hopefully people won’t erase their entire document when they are actually just trying to add a new field in them or set an existing field to a new value.