Do you know what the carpet is made from? I think an all wool or cotton with no backing might be nice in the garden and decompose along with the other mulches.
We lived where someone years before had laid down some synthetic shag carpet in the garden and the mesh backing and all of the 'shag' survived, the glue was gone so it was just bits and pieces at that point and impossible to retrieve....probably still there today.
When I was weaving I put several worn cotton rugs that I had made down layered with the mulch and they were pretty much gone in a year or so. I always liked the idea of making compostable weavings.
I had an old old woven straw/grass? rug that I used as a mulch once also...fast decomposition.
Should I worry about toxins?
Yes, I think so, many carpets are probably treated with 'stuff' ...I don't know what though.