Here is a tip for anyone who wants to use cheats with PS2 games on Batocera:
Find the .pnach files (maybe others too, just tested pnach) and add them to the folder in:
/share/system/configs/PCSX2/cheats (NOT /share/cheats as that did not work)
In ES menu, press F1 (on a keyboard) and go Applications -> pcsx2-config -> System -> Enable Cheats
Now all the cheats are enabled from the file!
(This must be done for Harry Potter - Chamber of Secrets to start at all, it needs a .pnach file)