Nether portals particles spawn in based on whether there are adjacent portal blocks on the east or west, not based on the portal block's axis. This is evident when using /setblock x y z minecraft:nether_portal to obtain an isolated portal blocks, or when making multiple adjacent portals along the z axis.
This could be resolved simply by changed the particle spawning logic to use the blockstate axis instead of checking adjacent blocks to see if they are also portal blocks
The first image shows that the current logic works fine except for the lone portal block in the top left, which has its particles on the wrong sides.
The second image shows a survival example, adjacent portals causing the particles to spawn on the wrong sides.