There are no hidden rules. The cannon works as normal.
In general, in DnD 5e, there are no hidden rules. The rules in the book are what they say they are. If the player shoves the end of their Eldritch Cannon into the mouth of an enemy before pulling the trigger, they'd make a ranged spell attack or force a Dexterity Saving TheowThrow as normal, depending on the option chosen for the cannon - and if it's the former option, the attack roll would even have disadvantage since they're in melee range of an enemy, unless they have one of the feats that removes that penalty.
If you want to justify it in-universe, presumably, on a miss or successful save, the enemy managed to pull the barrel of the Eldritch Cannon out of their mouth.