We need to see complete communication when it starts to lock up to know what is going on. RepRapFirmware is a bit different than Marlin so especially non conformant g-code style might confuse host. Better solution would be to connect with Repetier-Server to duet and then in host use server connector to still access printer via host if wanted. Server has dedicated RepRapFirmware description and definitively also understands commands sending strings, which host does not.