The remote computer crashes and shows black screen when using TeamViewer to connect

Options

My local computer is in Windows 10, and my remote computer is a Mac desktop with iOS. When I trying to connect the Mac using the TeamViewer, the Mac always crashes and shows black screen under a specific condition. The specific condition is: to connect when the Mac was just re-started and locked once. If the Mac has been locked for several times, I can connect it normally.

After the remote computer crashed, I have to hard reboot it manually. It is so troublesome. Could anyone please help? Thank you a lot.