I have issues with Safari when I need to upload a file from my local drive to some online service, then the Finder dialogue to choose the files never opens and when I do the exact same thing in Google Chrome for Mac, then there is no problem.
I asked Apple Support, but they suggested I read a totally unrelated support article.
Based on reports I found on Google it appears to be a reoccurring bug in Safari going back to at least 2021. In each case the fix was an update from Apple.