Fix "error":"case_clause" using latest=true

This is a port of
https://github.com/apache/couchdb/pull/3424/commits/a8622f0cca40d8f2338ec24b40f14d013a0f69d4
to main

Issue #3424
1 file changed