Also
Unless you use an external pullup or pulldown resistor on pin 3, your pin 3 is initially a floating input that might have set the interrupt flag. At the moment that you use attachInterrupt after that, it will trigger the interrupt.
Your code shows pin 3 ?
And lastly, it's still not full code ![]()