$ifNull not working as expected any help

I’ve recently made the switch from a self-hosted to a M0 cloud-hosted server, try before you buy to see if it is worth it for me kinda thing, and while doing some tests I have a problem with $ifNull.

simplified code

  const passwordHash = password == "" ? null : await bcrypt.hash(password, 10);
  let result = await accounts.updateOne(
    { _id: ObjectId(accountID) }, [{
    $set: {
      username: "name",
      passwordHash: { $ifNull: [passwordHash, "$passwordHash"] } }
  } ] );

but each time I try and update the account the passwordHash never changes, all the other fields do but not the passwordHash.

I have been trying to debug this for a few hours now and all the documentation I read is telling me it should work. I don’t remember this being a problem when I was self-hosting the server.

I don’t get any errors returned.
Is there anything I should do/check?