Duplicating a rig doesn't work
There can be different situations, but the concept is that the stack order of operations is important:

When you duplicate (or mirror, or copy and paste inverted, etc ....) something, the copies will retain all the issues of the source: this is the reason why your right side of the character is piloted by the left bones (probably you copied or applied the mirror AFTER assigning wheights).

One of the  correct sequences could be:

Finish half a mesh, set a mirror modifier and apply it (so you have a complete mesh).

Finish half a rig (Left side); rename all bones with a name which ends with .L (or .l); select all .L bones and copy and mirror them; while all new copied bones are selected, choose "Armature - Flip names";

So, when you have  a complete mesh and a complete rig, you can go with automatic weighting and everything will work as expected.

Remember that - before parenting - you could need to ALT P clear parent and delete all vertex groups of the mesh, to "clear" any previous unwanted setting.