Yes, actually. This only works for female horses changing into males as far as I know. And as far as I know they only spawn male horses, because Maggie all of a sudden was a male lmfao But then again the white arabian/cheat/camp spawned horses are always female
First you're going to want to do the companion glitch, any character you wan tor can get it does not matter.
Second get the horse you want (it must be below Bonding level 1) and dismount. When your companion dismounts steal his/her horse. They will mount the horse you want to change genders. Kill the gang horse and then mount the one that you want to change genders. She/He will spawn in the same horse except it is male! Steal the male and bond with it, I suggest immediately stabling/saddling him but keeping your companion in case it dies until you've done so.
Still works did it with the wild white Arabian with Dutch and the plashed white Paint with Lenny. Hope this helped!