Could you share how the flattenObjectValuesIntoArray function is implemented? The potential issue might be that you are wrapping book into and array. Another question would be what is the structure of books object/array.
Reasons:
Blacklisted phrase (1): Another question
RegEx Blacklisted phrase (2.5): Could you share how