There is more than one voucher code for Beats, so a single code posted online is unlikely to be the one you need.
Codes are usually tied to a region or a specific promotion, which is why some work and others return an error.