You are moving the view box through adding to its y-position.
Because of this the view box don´t do any collisiondetection and moves through the player. Maybe, you could use "clamp" instead of your view box like this:

clamp(player.x,camera.x-500,camera.x+500);
clamp(player.y,camera.y-700,camera.y+700);

For me there is no Problem with those terrains.
I´m using Version 6.50.2. Maybe it was a Problem with 6.40.5.

Hope this Helps