just in case, so you don't lose your second one ->
if you only use pokeballs, you can just buy a great-/ultraball and have some space between the masterball and the pokeballs
I had that, also had a ton of pokeballs so didn't make a mistake of idenity either, for some reason game just threw the masterball instead so gg.