I finally found the reason for that error. This error appears when a heat source defined in the "named expressions" is used with a periodic boundary condition. The error disappeared when I switched from periodic boundary conditions to velocity inlet and pressure outlet.  No issue was found when the heat source is plugged in using UDF.