Did you know that if you decide to just show your structured data markup to GoogleBot, Google's spiders/crawlers, and hide it from normal users in the source code, that would be considered cloaking. Cloaking is against Google's webmaster guidelines and can result in a manual action.
Google said you need to show both humans and GoogleBot the same HTML and not just show GoogleBot the HTML.
The question came up on Twitter and Google's John Mueller said that it is cloaking to do that. The reason was somewhat legit, the webmaster wanted to hide their structured markup from their competitors.
That's cloaking, I'd avoid doing that. Sometimes using a sitemap file is an option.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) November 28, 2017
But no, you cannot do that without potentially getting into hot water with Google.
Forum discussion at Twitter.