J4.x:Serialization is not allowed
From Joomla! Documentation
When Smart Search is used and the Gather Statistics is enabled an error may appear with the text "Serialization of X is not allowed." where X can be different like Closure or PDO or something else.
Errors reported
The error has been reported in issue https://github.com/joomla/joomla-cms/issues/38370
Versions affected
General Information
This pertains only to Joomla! version(s): 4.2.0
What is the cause
The cause lies in the serialization of the data where the data contains classes that cannot be serialized.
How to fix
The workaround for now is to turn off Gather Statistics in Smart Search