Passing an invalid value for the explain parameter throws an exception.
However, when useUnifiedTopology is set to true, the exception cannot be caught.
Tested with firstname.lastname@example.org and MongoDB server version 4.4.7
Please find attached a minimal example that demonstrates the issue. Note that setting useUnifiedTopology to false lets the application catch/handle the error.