I could reproduce the error. If there is no red interface, you’ll get this error, see Phpvirtualbox-5.2 needs testers
[root@testserver ~]# expand-template /usr/share/phpvirtualbox/config.php
ERROR in /etc/e-smith/templates//usr/share/phpvirtualbox/config.php/20SettingsRDP: Program fragment delivered error <<Can't call method "prop" on an undefined value at /etc/e-smith/templates//usr/share/phpvirtualbox/config.php/20SettingsRDP line 21.>> at template line 5
ERROR: Template processing failed for //usr/share/phpvirtualbox/config.php: 1 fragment generated errors
at /sbin/e-smith/expand-template line 45.
Maybe check if $red has content?
After setting up a red interface and expanding the template it worked:
expand-template /usr/share/phpvirtualbox/config.php