There were hundreds of soldiers killed near the border so its inaccurate to say there was no one there.
They were just completely unprepared and also outnumbered. Some of them died in their shorts, they didn't even get to wear their boots on time.
As for knowing about a plan - its unclear still what was known so we're all speculating here. Just because the enemy is training or even publicly saying it has a plan - doesn't immediately mean its going to attack or has the capability. Hamas was quite smart in simulating this attack many times throughout the years to make sure Israel doesn't take it seriously.
A lot of faith, way too much, was put on technology and the border barrier and both turned out to be completely useless.
Obviously the Israeli intelligence completely screwed up in interpreting the intelligence that was available. Hence why I said its inaccurate to say "Israel knew", this issue is much more complex for such simplistic remarks.