I have given my carpet nem natural food before as well, but really only damsels that I finally caught. I have had it eat a snail before too. I would say that if the nem accepted the shrimp then it should be able to process/digest it and expel what it cannot eat. Mine typically will not actually consume something that it does not ike.
It is difficult to tell if it is dying from your description. If it is the size of a 50 cent piece, how large was it normally? Are we talking a full grown carpet (mine is about 16" across) or a mini carpet. If the latter, I have no experience and wouldn't know about its feeding capabilities, but would guess a whole shrimp to be a lot of food. If a larger nem, that is an incredibly small size. not sure what could be going on. I would, indeed, watch it closely and get it out if you're sure it has perished. But I also would not panic yet either if it only looks shrunken/like it is digesting. Any chance you can get a pic? How long does it normally take to feed/digest? Any chance the shrimp died from a poisoning or ingestion of something that could be affecting the nem? Any changes to other parameters, flow patterns, temperature, etc. and it only seems like its related to the shrimp?
Looking for more info.