In fact, Setting 2 would only make sense to me if you..
...Have no inheritance of permissions to the top
...Only one usergroup has access to a specific task
Then it makes sense, if the superuser should simply have all tasks / views / options of the custom 1/2 groups this can be solved by inheritance in a cleaner way.
Edit: indeed superuser has no inherited ...
Most critical to fixing your issue is to include the p.ComponentId column in your select() call so that it is available at the time the result set is being constructed.
If you have your error reporting turned on/up, then I expect that you would have seen several of these:
Notice: Undefined index: p.ComponentId in ...
I have a few additional pointers to ...
That looks like a Yootheme template to me and I've experienced similar errors when updating Yootheme Pro when I've had a template override in place.
You might want to check if there's a template override for the search results page and if there is, try disabling to see if it fixes the error.