The error happens when a field in restrictSearchableAttributes parameter is not in toSearchableArray().
This is the toSearchableArray() method
public f