Taktaal
If this is actually dangerous you should contact Nidwalden tourism about it at https://www.nidwalden.com/en/

Maybe you just misinterpreted how the electric fence gates work though. Did you make pictures?