The stop and tail light bulb should only go in one way.
If you look at the bulb you will see the little lugs are offset for this purpose.
If you can put the bulb in the wrong way it would suggest the holder is slack.
If stop works but tail does not that would suggest the earth is ok but the battery is missing.
Realy, it's looking like a poor quality fitting. Give it a tweak with a pair of long nose pliers.
Pete.