Instantiated Object Wont save a reference to the prefab, instead sets to itself

Weird Problem I have encountered. So for my game i need to add 100s of different weapons. Now right now i have to add more code for every weapon to check if the mags are for the weapon when reloading. I need to combat this because it is impractical. So i have some code right here.

if (HasMag == false && other.GetComponent<MagScript>() != null && == other.GetComponent<CanInteractWithThis>() {

I assign the mag prefab into the gun spot in the inspector. Like so.124215-capture.png

Then with the mag i do the same. the mag and the gun have the same script on them. The code above is suppose to check if the names are the same and if so let the reload occur, but here is the weird thing. When i instantiate the mag. The inspector no longer shows the assigned prefab on the mag to be the prefab, it assigns it to be itself. Like so. 124216-capture.png.

Is there any way to get around this or maybe a different way to check? Thanks for taking the time to read the text wall, and thanks to everyone who will help.

I made it work using a string i can put in the inspector but if anyone has an answer to this i would really like to know.