yes you have to first file return only then you could claim refund. furnishing of return implies that taxes have been paid to govt, and a person can claim refund only if paid to government
“87(13) A registered person may, on the common portal, transfer any amount of tax, interest, penalty, fee or any other amount available in the electronic cash ledger under the Act to the electronic cash ledger for integrated tax, central tax, State tax or Union territory tax or cess in FORM GST PMT-9.
As per Notification 31/2019 CT , you can file PMT 09 can transfer the wrong deposited GST to your Desire Head but the same will be come into force only on date of their publication in Official Gazette. hence it's not in Force as on today
Note : Thats why PMT 09 is not available on portal