Does an Iron Flask (5e) work on a creature that is immune to Charm?


The Iron Flask states, “You can use an action to remove the flask’s stopper and release the creature the flask contains. The creature is friendly to you and your companions for 1 hour and obeys your commands for that Duration. If you give no commands or give it a Command that is likely to result in its death, it defends itself but otherwise takes no Actions. At the end of the Duration, the creature acts in accordance with its normal disposition and Alignment.”

Now my issue with this comes from the following incident that just occurred in my past session for Baldur’s Gate: Descent into Avernus. The players traversed the Scab prior to entering the Bleeding Citadel to find the Iron Flask amongst the deceased Night Hag’s obejects in her lair. They released the Fiendish flesh golem and killed it due to it not being their’s and attacked them so says the module. They still held onto it after the wizard identified it and realized its potential for demons if anything. So they eventually came across the diggers trying to dig out the Crokek’toeck. They killed them and reached the beast themselves to capture it in the Iron Flask instead. The bit I’m concerned with is they intend to use the creature as a trump card and have it serve them in battle for the hour use.

What I don’t understand is that the item doesn’t explicitly state that this is a charm on the creature to force its friendly position towards the party and adhere to their commands. The crokek’toeck has immunity to charm and confuses me as I presume the Iron Flask technically charms said captured entities to obey their temporary master(s). Due to the fact the item neglects to state this; do I proceed with the crokek’toeck being immune to the friendly nature once it pops out and proceeds to flee, attack, etc the party, or is this Flask meant to override that immunity and it works as they think it would, therefore obeying the party? I’m seeking a logical answer prior to flavored suggestions.