I can assure you that the issue is not because of the function being called from record group;
I've used query showing value from function; but one thing that you must keep in mind is :
If you create an unbound item in a lov based of sql expression which
return a datatype character, and if the bound item used in the function
is generated with a size 0, then the unbound item is generated
with a size 4000 and compilation of the form failed with error FRM-30187
the solution to the above problem is : lov property > Column Specification > one columns will be having length greater then 2000 there set it to 2000 which is maximum value. Then it will work.