When you spray paint m4 with a stanag on it, the stanag disappeares. It is put inside your inventory if you have the space or if not it drops on the ground.
If you relog, the magazine is visible and it works as intended. You attach it to the gun and start shooting.
Tested and reproducible with akm drum mag and m4a1