A micro-nano lock-in heterostructure has attracted significant attention for electrochemical sensor application due to its high specific surface area, more exposed active sites, and fast ion transport. Despite these advantages, here we prepared lock-in hetero structured tungsten oxynitride (WON) with a flower of CuO architecture by using the impregnation method. The tungsten oxynitride (WON) was prepared from the doping of nitrogen over the lattice of WO3 via a reactive NH3 gas etching process which turns WO3 nanoflakes (NFs) into the WON etched nanoflakes (EFs). The EFs act as cages to hold the hydrothermally prepared CuO micro flowers (MFs) and forms a new type of ‘lock-in’ heterostructure. This structure enables the stable and faster charge transfer between the CuO MFs and WON EFs, resulting in an efficient electrochemical performance towards the detection of diuron herbicide. The prepared CuO/WON were subjected to physiochemical characterizations such as X-ray diffraction (XRD), Raman spectroscopy, and X-ray photoelectron spectroscopy (XPS). The morphological and elemental information was interpreted by field-emission scanning electron microscopy (FESEM) combined with EDX and mapping analysis. Then, CuO/WON/GCE sensor electrode exhibited a wide diuron (DU) detection range of about 0.01–764.4 µM. Moreover, the estimated limit of detection and sensitivity from the slope of DU detection is 5.5 nm and 0.445 µM µA−1 cm−2 respectively. The practical applicability of the sensor electrodes was tested in the DU-added grape juice, orange juice, tap water, and river water samples.