Root cause
SERVER-128347 made the shell validate BSON produced by the JS engine in ObjectWrapper::toBSON(), which enforces the bsonMaxExpandedMemUsage limit (default 200MB) on BSONColumn expansion.
bucket_exceed_uncompressed_mem_limit.js relies on that 200MB default and builds a bucket that expands past 200MB. Both Object.bsonsize(bucketObj) and the insertOne serialize that bucket through ObjectWrapper::toBSON(), so the shell now rejects it with InvalidBSONFromJavaScript before the server is reached.
Proposed fix
The test should set bsonMaxExpandedMemUsage to a small value at startup rather than relying on the 200MB default and building a 200MB bucket. Set the server limit to e.g. 64KB and shrink the crafted bucket so it expands to a few hundred KB:
- expansion < 200MB -> shell serialization passes
- expansion > bsonMaxExpandedMemUsage -> server rejects with ExceededMemoryLimit