One thing about FSOpen is that it is not a ROM trap, it is provided by glue in your development environment. (The low level trap is PBOpen.) It is possible that your development environment may not support the oldest Macs. I've run into such issues. For my Mini vMac Extras I tend to not use the provided headers, and instead use my own file "MYMACAPI.i". This also makes it easier to work with multiple development environments and not be affect by name changes like GetDialogItem/GetDItem. (My "FILEUTIL.i" provides some higher level file routines using the low level traps defined "MYMACAPI.i".)
For GetDialogItem, that should be a low level trap, so there must be another reason. Your code doesn't include where "dg" is defined. If it wasn't properly initialized that would cause problems.
For GetDialogItem, that should be a low level trap, so there must be another reason. Your code doesn't include where "dg" is defined. If it wasn't properly initialized that would cause problems.