Experimental demonstration of a quantum anomaly induced by borders