Yes, showing structured markup just to bot qualifies as cloaking and can get you penalized, according to the following Twitter answer from Google’s John Mueller:
That's cloaking, I'd avoid doing that. Sometimes using a sitemap file is an option.— 🍌 John 🍌 (@JohnMu) November 28, 2017
There is also the “Spammy Structured Markup Penalty”, which can apply to websites that implement an structured data markup in an unacceptable way.
Google manually penalized more than 10,000 sites that tried to play the algo or that did not meet their quality guidelines for structured data usage. Examples include faking the number of reviews, using AggregateRating on product listings (or across all pages).
“We took manual action on more than 10,000 sites that did not meet the quality guidelines for inclusion in search features powered by structured data” – source