Engineering a multidimensional polarity-switchable material to achieve the full range of transportation and comprehensive benefits is highly expected, which should provide an advanced switcher for sensing. This work, for the first time, reports the synthesis of the 2D/3D Sc2O3@CuO layered octahedron through simple carbonization of a 1D/3D scandium-doped MOF-919 (MOF-919-Sc) networked octahedron. Based on the as-synthesized 2D/3D Sc2O3@CuO layered octahedron-induced photocurrent-polarity switching of a TiO2 dodecahedron, a novel polarity-switchable photoelectrochemical (PEC) sensor is constructed for the detection of kanamycin (Kana), combined with target-triggered enzyme cleavage-assisted signal amplification. The fabricated PEC sensor shows high selectivity and sensitivity with a linear range of 0.1-500 pM and a detection limit of 26 fM. Importantly, we propose the Sc doping MOF-919 to increase the dimensionalities of MOFs, and simply carbonizing to change the dimensionality, which offers a new idea to fuse a multidimensional, high-performance polarity-switchable material. This 2D/3D Sc2O3@CuO layered octahedron-based PEC sensor holds great potential for accurate detection of trace antibiotic residues and other small molecules.