So you can equip attachments from a menu for ages now but I have found a way to make it crash the game.
By attaching an attachment to a weapon that makes it impossible to attach another attachment to that same weapon the UI will end up in the twilight zone.
So I am running AIMNAS on a 8072 exe and this is what happens.
I tried to reproduce it with default 1.13 but I couldn't. I made the "2x Scope" (ID 1029) incompatible with the "Reflex Sight" (ID 1006) in "IncompatibleAttachments.xml" but no matter what I attach first, the second item will just produce the expected error message and the UI is just fine. There must be something else that causes this bug to happen.
It's been a while since I've played AFS, but i saw this exact same bug a few times there as well.
I guess this is mod related then, could be the amount of items the mods contain, could be the attachment slot layout that differs from 1.13 itself.
It might be, and I'm also a notorious hoarder, so that's another thing in common. Also, I just remembered another thing that might be useful (but it would be worth testing it first, like I said, it has been a while since I've played AFS). The bug only occurred if the player left-clicks on a slot a selects an incompatible attachment from the menu that pops up (and from the pictures you uploaded it seems that that's exactly what you did), but if you just pick the attachment from the sector inventory a manually place it in the slot everything is okay.