If the transmission range sensor is faulty, the TCU may not receive the correct signal, causing the D4 and Park lights to stay on together. This can also cause the transmission to shift into the wrong gear or not shift at all. In some cases, the transmission may even go into limp mode, which is a reduced power mode that limits the vehicle's speed.
If you notice the D4 and Park lights staying on together on your Honda Accord, you should have the vehicle inspected by a qualified mechanic. The mechanic can diagnose the problem and perform the necessary repairs.