Yes, the source database is scripted and created using DB Ghost.
I have created an empty test database with two functions:
CREATE FUNCTION F2 () RETURNS int
AS
BEGIN
RETURN 1
END
CREATE FUNCTION F1 ( @p1 int )
RETURNS @Result TABLE
(
col1 int
)
AS
BEGIN
insert into @Result select [dbo].[F2] ()
RETURN
END
But good question. I've tested this problem again and the problem is the build task of DB Ghost. After build there are no references between F1 and F2, because they are created in alphabetical order.