After some testing I think I figured out how the "leaking acid" mechanic of XAL-001 works.
It basically copies the attack against the enemy and applies it to you. So if it misses you are not going to suffer any damage either, if it hits you are going to suffer the exact same amount of damage as the enemy (what's more, you are even going to suffer bonus damage from feats like Opportunist if the enemy meets the conditions, even if you don't met the conditions yourself), if the acid entanglement procs you will become entangled yourself, etc.
Sadly I don't have 100% acid resistance to test with, but I think it would also apply corroded debuff to the PC even though he effectively resisted all the damage. That's really bad as corroded is going to lower said resistance.
What's funny is that the combat feed actually shows as if you are attacking the enemy twice instead of attacking yourself, so it's a bit confusing.
On top of that it also spawns an additonial layer of acid puddles all around you regardless of if you hit or miss. The trouble is, it's always a standard acid puddle. So if you shoot corrosive ammo out of it, you end up surrounded with one layer of standard green puddles and one layer of corrosive puddles. Doesn't make much sense, but from what I understand the mechanic was implement long before corrosive ammo was a thing.
Another thing is that the gun doesn't leak at all when used with special attacks such as Aimed Shot, Kneecap Shot and Point Shot, only on regular attacks.
Also, arelated question- I'm wondering why chemical pistols can't be unloaded. It's not like we are pouring pure acid/cryoliquid/incendiary directly into the gun, we are loading it with self-contained vials. Also, reloading an acid blob pistol with corrosive vials while it's loaded with standard vials (or vice versa) gives the standard vials back, so it is possible to get the vials out of a loaded gun. Bit of an inconsistency here.
Also, this one is more of a suggestion, but I can't say I'm a fan of the entire mechanic to begin with. It basically punishes you for improving your damage. There are ways to achieve +/- 95% DR against acid and immunity to immobilization with CAU armor and very high quality infused siphoner tabis, or even 100% with mutated dog leather tabis, but it still doesn't feel right. It also seems prone to many issues in general as stated above.
In my opinion static acid damage dealt to the player with no entanglement/corrosion debuff would work out much better and probably less prone to issues/bugs. The gun would still require highly dedicated gear to resist this damage while top quality crafted acid blob pistols have much bigger chance to proc acid entaglement and will deal more secondary damage, especially with Mad Chemist (44% and 110%/220% damage with 120 quality dispenser, XAL has only 30% and 100%). Not finishing the quest means less XP, too.
I think those things are a good trade-off for higher base damage and 9 AP less to shoot. Chemical pistols really could use some love.