Lots of games that have tried to be 'funny' or 'comedy' games first and foremost have often failed super hard at their goal of actually being funny in my experience.
A recent example (though I feel just a little bad for calling it so) was
Sir Whoopass. https://store.steampowered.com/app/1240590/Sir_Whoopass_Immortal_Death/ intolerably painfully unfunny for me, though many others enjoy it. This one really didn't resonate with me and i got through the tutorial before promptly refunding it.
However sometimes it can 'just work' to an extent. I guess personal tastes account for this variation, but a different recent example is
Bears in Space https://store.steampowered.com/app/1309620/Bears_In_Space/ which I did find genuinely funny in parts. Still intend to return to this one.
otherwise for games where they weren't created as a 'comedy first and foremost' game, here a couple others i recall:
Disco Elysium has some fucking hilarious moments particularly of failure
Bugsnax had some lines catch me completely offguard and overall toed the line of silly competently
Hypnospace Outlaw is amazing and very funny all throughout if you are of the demographic its style is riffing on
Hitman World of Assassination games are all fucking hilarious imo
Yakuza (all of them) even to someone such as a, crusted old doesn't like that weeb shit-ter, the series completely won me over with its contrast of crime soap opera with anime silly uwu.
lastly
Fight of Animals not because it has jokes or comedy in it or anything but because you can play as CROWRILLA vs EGGDOG et al
https://store.steampowered.com/app/1160330/Fight_of_Animals/