I am non resident for 2020 but had w2 and stock income in US. My CA filed and paid my tax as non resident on that income . Should i have paid in resident country only?

Is the CA wrong in paying taxes in US - can I show these paid taxes as tax credit in resident country?
It's my first year being US non resident