Take this archive that has a basic port of the Gladiator enemy from Quake II. It has two monsters, Gladiator and AimGladiator. The Gladiator has aim:2 in its A_CustomRailgun call, and this causes the spawnofs_xy param to move forwards and backwards instead of left to right. The AimGladiator, however, has aim:1 for the railgun, and it moves the railgun source left/right as needed.
This bug seems to be fairly longstanding, since the actor isn't very complex at all, I was able to load it in one of the last dev builds of zdoom that supported zscript (far back enough that the -zscript param was needed), and the railgun seems to have the same issue there.