You need at least 1/4" of cable jacket inside the box
You need to make sure at least 1/4" of cable jacket enters the box. This is required by NEC 314.17(B) for metal boxes and (C) for plastic ones in order to ensure that the cable clamp clamps the jacket, strain-relieving the jacket to the box so that stresses on the cable aren't transmitted to the connections in the box and protecting the insulation on the wires inside the cable from being damaged by the clamp bearing directly on them:
(B) Metal Boxes and Conduit Bodies. Where metal boxes or
conduit bodies are installed with messenger-supported wiring,
open wiring on insulators, or concealed knob-and-tube wiring,
conductors shall enter through insulating bushings or, in dry
locations, through flexible tubing extending from the last insulating support to not less than 6 mm (¼ in.) inside the box and
beyond any cable clamps. Where nonmetallic-sheathed cable or
multiconductor Type UF cable is used, the sheath shall extend
not less than 6 mm (¼ in.) inside the box and beyond any
cable clamp. Except as provided in 300.15(C), the wiring shall
be firmly secured to the box or conduit body. Where raceway
or cable is installed with metal boxes or conduit bodies, the
raceway or cable shall be secured to such boxes and conduit
bodies.
(C) Nonmetallic Boxes and Conduit Bodies. Nonmetallic
boxes and conduit bodies shall be suitable for the lowest
temperature-rated conductor entering the box. Where nonmetallic boxes and conduit bodies are used with messenger-supported wiring, open wiring on insulators, or concealed
knob-and-tube wiring, the conductors shall enter the box
through individual holes. Where flexible tubing is used to
enclose the conductors, the tubing shall extend from the last
insulating support to not less than 6 mm (¼ in.) inside the box
and beyond any cable clamp. Where nonmetallic-sheathed
cable or multiconductor Type UF cable is used, the sheath shall
extend not less than 6 mm (¼ in.) inside the box and beyond
any cable clamp. In all instances, all permitted wiring methods
shall be secured to the boxes.
Exception: Where nonmetallic-sheathed cable or multiconductor
Type UF cable is used with single gang boxes not larger than a nominal
size 57 mm × 100 mm (2¼ in. × 4 in.) mounted in walls or ceilings,
and where the cable is fastened within 200 mm (8 in.) of the box measured along the sheath and where the sheath extends through a cable
knockout not less than 6 mm (¼ in.), securing the cable to the box shall
not be required. Multiple cable entries shall be permitted in a single
cable knockout opening.