I'll repeat what I understood from your question because you're not being very clear. If I misunderstood please correct me in a comment and I'll adjust the answer.
- You are a foreigner in the US, arriving into US on or before January 1st, 2022.
- You passed the substantial presence test for the year 2022 and are considered resident for the whole year. I'm assuming that you took into the account your immigration status and potentially exempt presence days (if you're a student for example).
- You had someone paying interest to you in 2022, to whom you gave a W8 certifying you're a non-resident.
- You received a 1042-S for the year 2022 that exempted interest payment based on that certification.
- You now realized that that certification was incorrect as you were in fact a resident, since you passed the substantial presence test.
Had you submitted W9 instead of W8, what would the bank have done?
You would still not have anything withheld since the US doesn't require withholding at source for interest payments. However, the exemption does not hold and the interest is taxable.
Had you properly certified your resident status, you'd receive a form 1099-INT reporting the interest paid to you, instead of 1042-S. The fact that you received 1042-S instead of 1099 doesn't change the tax liability or the taxability of the income. The interest paid to you should still go to Schedule B of your tax return. You should send a proper W9 to the payer so that they will report it correctly from now on, and if possible ask them to issue a corrected 1099-INT for 2022 (they may not want to though, but it's just paperwork).
As long as you report the interest on your 1040 and pay the appropriate taxes you should be fine.