A Schauder-type theorem for discontinuous operators with applications to second-order BVPs