When a guardian attacks a player or a squid, the laser attack sound (and subtitle) will play at the same volume, even if the player is hundreds of blocks away.
Enter creative mode and locate a large body of water.
Summon both a guardian and squid in the water.
When the guardian begins to shoot the squid, quickly teleport yourself 75 blocks up into the sky.
/tp @s ~ ~75 ~
Listen closely and take note as to whether or not the minecraft:entity.guardian.attack sound lowers in volume depending on the distance between you and the guardian.
Dupe to MC-57057
Related issues
Comments

Sorry, I didn't know MC-57057 was still being treated as unresolved