It would appear that you do need a visa.
“Transiting without a visa is possible for:
Nationals of Ghana arriving from a non-Schengen Member State with a confirmed onward ticket for a flight within 24 hours to a third country which is not a Schengen Member State. They must:
have a visa issued by Bulgaria, Canada, Croatia, Cyprus, Ireland (Rep.), Japan, ...