This is a problem that I've been having for quite a while. It has been consistantly happening in El Capitan with Teamviewer 11 and now with Sierra using Teamviewer 12. When I updated to v12 it didn't do it the first couple of times that I tested it but has since done it every time. My screen ius set to turn off after a minute of inactivity and it does except when my iMac is accessed via Teamviewer. I use it as a media server so I don't want the computer to sleep but I do want the screen to turn off.
thank you very much for your post.
If I understand your request correctly, you do not have a problem to access your the Mac during the monitor sleep mode.
When your settings are correctly, your screen should go to the sleep mode after ending your TeamViewer session.
If you like, we can check your issue and need more informations.
We kindly ask you to provide us your log files and system information for further analyze the problem.
Could you please download our Support Collector app from the following link:
Then run it and step through the wizard. Once it has finished, it will generate a file called "SupportCollector.zip", in the same folder as the app, containing diagnostic information.
Could you please submit it as attachement in a ticket to our Support Department on https://www.teamviewer.com/en/support/contact/subm
Thank you in advance and please excuse the inconvenience.