Good to hear swapping back fixed your issue. I was pretty certain it would.
As for the flasher, unfortunately that will only solve one problem. LEDs cause several problems. WARNING: none of what I'm about to ramble about matters since you're staying stock anyways, but I may as well explain the deal and how it works for anyone interested.
LEDs draw very little power compared to an incandescent equivalent bulb. The flasher relay is built to blink when a certain amount of power is pulled through it, which is calibrated to how many incandescent bulbs are on the vehicle. On the YJ, the turn signal flasher (not the hazard, there are two total flashers) is calibrated for basically 2.5 bulbs since the front and rear bulbs pull about 27W each and the side marker fender bulbs pull about 12W. When you change to LEDs, you screw up the load, and the flasher stops working. On modern cars, it's computer controller and the computer will blink the flasher in hyperflash mode. So, the flasher you linked is for blinking the circuit properly when you have converted to all LEDs and no longer have the proper load for the stock flasher. The flasher you linked is computer controlled in and of itself, so it knows exactly when it wants to blink.
There are other issues with LEDs, though:
1) they are polar, like you experienced.
Most LEDs will only accept power in one direction, which means ground works on one pin and power on the other, and if the bulb is installed backwards in the socket, it won't work. In your case, the bulb worked half the time, but not the other. Flipping the bulb would have reversed your results. The problem for a polarized bulb in the YJ side marker setup is that like I've explained, they see power from either of the two wires, which means the bulb can't be polar to work in this application.
The fender bulbs are a 2-wire bulb that are spliced directly off of the power to the front parking lamp bulbs. The factory parking lamp bulbs are incandescent and will let electrons flow through them either direction, so this works well. The side marker is spliced to the parking lamp (+) and the turn signal (+). During the daytime, headlights are NOT on, if you turn on the turn signal, the side marker will get power from the turn signal wire when the turn signal is on. The side marker as such, will blink in unison with the front bulb. The side marker gets its ground by being connected to the parking lamp filament of the front bulb. The side marker's ground runs through the front bulb, to ground.
When it's night time, and the headlights are ON, the side marker gets a constant power signal from the parking lamp (+) wire. It grounds through the turn signal filament of the front bulb. This works fine for a constant night time running lamp. When headlights are ON and you turn on the turn signal, the bulb sees 12V (+) on both wires (the parking lamp from the lights being on, and a blinking 12V from the turn signal wire. When the bulb gets 12V on both wires, it shuts off because it no longer has ground. Thus, the bulb blinks opposite of the front turn signals when the headlights are on.
So........
Get a non polar bulb if you just want to install in the side marker and have all work as intended. A non polar LED will work perfectly in the side marker with no issues at all, because it will be compatible with power coming at it from either wire, and getting ground on the other wire.
The bigger issue is when you go to put LEDs in the front grille locations. Remember the explanation of how the side markers get ground through the front bulb filaments? That no longer works when an LED is in place. No amount of resistors or flashers will fix this issue.
The fix for that is to rewire the side markers so that they are independent of the front lamps.
This is a good write up to fix that issue:
LED Side Marker Mod. Essentially the fix has you rewire the 2-wire side marker to perform like a 3-wire bulb, while still using a 2-wire LED bulb. You use a small resistor to artificially dim the LED for a parking lamp setting, and then you have a full brightness turn signal where the bulb shines at it's normal brightness. This means you need to choose a bright LED for it to be a good choice. Overall it's a pretty cool mod but most won't bother with it. I did do it to mine just for the unique cool factor, but I get that most won't. It adds complexity and there is no real benefit besides using cool LEDs.
Once you address fixing the side marker, then you can put LEDs in all locations, and that's when you would want to use that computer controlled flasher. You can also use that flasher if you simply swap the tail lights or if you put a non-polar LED in the side markers.