By custom command are you referring to Vendor commands? For vendor commands you can use the control endpoints also. Refer to the GPIF TO USB example on how to handle vendor commands in the FX3 firmware.
It is similar to vendor commands. But we are using a separate two Bulk endpoints for handling them. We don't use the control endpoint to send our custom commands.
I want to know whether the procedure I have followed when handling the packet is correct or not.
It would be easier if you use control endpoints to handle the vendor/custom command as mentioned. But, if you have already developed a method to handle them using BULK, then it is okay. You can refer to the bulksourcesink firmware if you want to implement a similar application. Yes, your approach seems correct.