Using the getHighestBlockAt(x, z) always return the heighest block of level generator.
If could be helpful, use this code:
public function onPlayerMove(PlayerMoveEvent $event)
{
$p = $event->getPlayer();
$to = $event->getTo();
$ground = $p->getLevel()->getHighestBlockAt($to->x, $to->z);
$p->sendMessage("Ground = " . $ground);
}
I can confirm getHighestBlockAt often does not return what you expect it to return...
This is because the heightmap is never updated. This issue is fixed on the mcpe-1.1 branch.
@matcracker Extracted from CONTRIBUTING.md:

@dktapps In which commit on the mcpe-1.1 branch was this issue fixed?
Most helpful comment
@matcracker Extracted from CONTRIBUTING.md: