Ok.
This hasn’t fixed it, but I think you should create a PR proposing this fix to the mongodb repo that also has this error.
I was going to do it, but it looks like I would be taking credit for your observation if I do so.
However, if you’re too busy to do this, let me know so I can create a PR in your stead.