Interfund transfers between Securities and Commodities are not allowed on Upstox. You will have to withdraw the funds and need to deposit them again in the correct segment.
However, keep in mind that you can’t withdraw on the same day. You will have to wait for T+1 (trading + 1) day or T+2 (trading + 2) days to transfer funds from the respective Trading Account to the Bank account
Please check the below link to know, How to withdraw funds on Upstox?