What's difference in commandLine and IDE of gradle tasks?

i have a Android project, it has a build task called ‘buildBundleDebug’, when i run this task in AndroidStudio ,everything goes well, but when i run in the commandLine, it goes fail, i compare the difference between the two ways, i found that their execution of the task is not the same.

in gradle docs ,it says in gradle’s configuration phase, there will be analyzed and determined which tasks will participate in the build, so regardless of whether it is on the command line or in the Android Studio, the tasks involved in building should be the same, but actually the two ways has difference, so i am confused.

why and what’s difference in commandLine and IDE of gradle tasks ?

Can you give the relevant details for the failure?

There is no clear reason for the failure,
‘buildBundleDebug’ task is a custom task in a third-party plugin, this task took over the original Android build process, when running this task in AndroidStudio, there will execute the third-party plugin build logic correctly, but in commandLine, there will execute the original Android build logic, i can not understand why are there differences between the two ways?

the two ways is the same ,that’s my code bug.