Policy is that you have to go get one off the floor. You can't just return the item and then buy it back for the gift card. The logic is that it has to be available to (other) guests before you buy it. I know I've heard of TMs being busted for buying items that they stashed in the wrong location on the floor or took it out of the fitting room or a returns basket.
As far as whether you'll get busted for it or will even be allowed to by Guest Services... YMMV.
You can't buy anything from the backroom! A TM needs to pull the item after you buy it and another one needs to work it to the floor to replenish the one you just bought.