My Federation type 2 phaser (stun) seems to have a bug where when I use the secondary fire mode (stun beam setting) it only slows enemies and does not hold/stun them for the expected duration (I recorded the stun time on a "working" stun pistol as about 5 seconds). The stun setting still slows enemies for the expected duration so it's not completely useless and still pairs well with my photon grenade. As for the testing, I tested a "standard issue" stun pistol (one you can make with the replicator) and its stun beam effect worked just fine without issue. To get consistent results I tested the weapons on Tholian workers at the Nukara ground battle zone with the same build to confirm it wasn't any of my traits or passive abilities causing the bugged pistol to not work.
Edit: After further testing, it seems that this bug affects most stun pistols, all except for the standard issue phaser stun pistol, available to make from the replicator. These weapons do not stun/hold enemies and only slow their movement speed.