Baumgärtner is a rare spelling compared to the much more frequent spelling Baumgartner.
Fehring is in Eastern Steiermark, near the border to Burgenland, which before WW I was part of Hungary. It was easily possible that a man from Fehring married a woman from Hungary, especially after the abolition of bondage/serfdom in 1781.
Do you know the name of his wife? Was this his only marriage? Do you have a copy or extract of their marriage record? Do you know the names and approximate dates and places of birth of their children?
You could write an e-mail to the Diocesan Archive at Graz, in which you ask whether the records of Fehring include birth(s) of Josef Baumgärtner or Baumgartner around 1840.