Based on the screenshot of log entries it's not possible to say what could be the problem as it just shows few connections to port 5938 opened and closed. Perhaps TeamViewer also tries opening some other connections that are not allowed. Anyway only way to better analyze and understand the problem would be to collect traffic captures on NGFW internal and external interface while you TeamViewer connection is attempted and fails. Based on the captures you can see what traffic is created and how those connections work, and you can then also relate that to log entries.
Also if you have active support, you might wish to open Service Request for this.
I've opened a service request. I'll place the results here as soon I got them.
Regarding Teamviewer communications, I've the following theory. If there is an application that detects teamviewer traffic, we shouldn't worry about ports and protocols. Anyway, Tamviewer application have the following ports: 80, 443 and 5938. Also traffic hits the correct rule at Outbound (leaving FW). I can't detect any problem at inbound (if is another flow).
Anyway, thank you very much for your input.
I've got the same problem. After small investigation I found the reason - file filtering policy. If policy was setup to filter "all" services some type of traffic was blocked. I've changed my policy to filter only "supported" protocols - http,ftp and now it works.
I'll give a try and return with the results.
I also have an open incident with support and I'm waiting their feedback.