Please see details logged here with DevExpress - https://supportcenter.devexpress.com/ticket/details/t1207906/aspnet-data-remote-grouping-fails-if-isexpanded-is-false-with-the-latest-mongodb-drivers
They have also reached out here - https://www.mongodb.com/community/forums/t/unhandled-exception-while-casting-object/265345 but have had no response.
This is now a blocker for continuing to use the DevExtreme middleware with more recent versions of the MongoDB driver since v2.19 which is a major concern for us as we are heavily using this middleware to construct MongoDB aggregation queries.
I am posting this on behalf of DevExpress technical support as they have been unable to progress the issue further at their end.
Would be very grateful for some analysis and suggestions as to how this problem can be resolved.