Try casting the entity/player through a function rather than an event.
My knowledge of functions isn't great, but I believe this is what you were referring to. Feel free to correct me if I'm wrong.
code_language.skript:
function disguiseMob(d: text , e: entity):
set {_d} to new disguise with type "%{_d}%"
set disguise of {_e} to {_d}
command /disguisechicken:
trigger:
spawn zombie at player
set {_entity} to last spawned zombie
set {_disguise} to "CHICKEN"
disguiseMob({_disguise} , {_entity})
On reload of the skript I get this error in game: "There's no player in a function event" referring to the line "set disguise of {_e} to {_d}"
No errors in console. It seems to hate me no matter what I try.