DT4b3, JXA: wrong type of parameter passed in lookupRecordsWithTags

This line of code
const foundRecords = app.lookupRecordsWithTag(['document', 'handwriting'], {in: database});
is (according to Script Editor) converted to this AppleEvent
app.lookupRecordsWithTag([["document", "handwriting"], {"in":app.databases.byId(2)}])
So, instead of (Array, Object), the method receives a single Array (containing an Array and an Object). Which, of course, results in a “message not understood” error.

Am I doing something stupid or is this a glitch?

No surprise as the name is lookupRecordsWithTags.

Thanks for the spelling help!