200 mA output from the Arduino digital output
First of all, diodes always need a current limiting resistor. In this case apparently at least (5V - 0.8) / 200mA = some 20-25 ohm at the very least. Otherwise you risk burning the diode.
Second, the output current of your MCU is not 40mA per pin! 40mA/pin and 200mA total are absolute maximum ratings.
When reading any electronics datasheet, you should design after typical characteristics and not the absolute maximum ratings. Absolute maximum ratings = what the part can withstand for a short, often unspecified time, if stressed. All engineers know this, though to make it extra clear, it is also explicitly rubbed in the reader's face by the friendly manual of ATmega328P (28.1):

This is a stress rating
only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this
specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

The friendly manual states the following below DC characteristics (28.2):

You need to design after these source/sink conditions depending on MCU pin used.

The correct solution here is to use BJT or MOSFET, or perhaps some manner of specialized LED driver, depending on if you need PWM or not.