Add unit tests for error conditions of `bagof/3` and `setof/3` built-in method calls