It is ok to do so. If you take out the money and pay it back, go to the bank counter to pay it back. Or even more troublesome, you deposit your money in a bank card and then directly repay it to another credit card through online banking.
However, cash withdrawal is not interest-free, but will generate handling fees and daily interest, which is five ten thousandths of the cash withdrawal amount. You should still be careful.