I solved setting in the main file:
set -o functrace
From BASH man:
If set, any traps on DEBUG and RETURN are inherited by shell functions, command substitutions, and commands executed in a subshell environment. The DEBUG and RETURN traps are normally not inherited in such cases.
Being 'source' a shell function, they are inherited.