Google will view everything and ignore any attempts to hide content with CSS. A human visitor will only see what you want them to see…
Now if the heading was different to the displayed heading, it could have potential to be an issue if done en masse with multiple headings which were hidden with CSS , keyword stuffed and ‘just for search engines’.
But it’s one heading, a duplicate of an existing heading. So hardly like you’re out to deceive Google.
A similar example would be carousel sliders, hiding headings until they scroll into view.
Accordians which could be hiding headings until toggled into view.
Maybe a desktop or mobile version of a heading, hidden for design purposes.
Plenty of reasons why a heading could be hidden legitimately and many more for trying to game Google I’m sure!
If I am not mistaken they have been indexing display:none for sometime already and don’t have a problem with it. Back in the days tabs on websites was a big thing and even Matt Cutts long ago had actually done a video about it. So you should perfectly fine. If you are hiding spam type content which Google understands then you could receive a manual action at that point.