External links are indexed by google under my domain name

Hello, how can i stop google from indexing the links that i have on my _redirects file

this is what i have in my _redirects file:

/123456/ https://example.com/something/ 301

now if i go to mydomain.com/123456 i get redirected to https://example.com/something/ without any problems

but if i searched for my domain name on google i find the url mydomain.com/123456 which i don’t have on my sitemap and i also have a nofollow linked on it and i don’t want it to apear on google

the question here is how i should stop google from indexing my redirects

I think to google’s bot, the redirected path might look like duplicate pages. You could try adding a canonical url tag to your pages, as described in the docs about canonical urls from Google.