Cast Ray to ground from position. Expected result to be typeof object, actual typeof was undefined

Have a error I cant seem to get past. Looking from the startPosition, I want to see where the ray intersects the ground.
var startPosition = Cesium.Cartesian3.fromDegrees(-89.3350,34.65874, 60);

var heading = Cesium.Math.toRadians(2); // Convert to radians
var pitch = Cesium.Math.toRadians(-30);
var roll = Cesium.Math.toRadians(0);
var direction = new Cesium.Matrix3();
Cesium.Matrix3.fromHeadingPitchRoll(heading, pitch, roll, direction);

// Create a ray from the starting position and direction
var ray = new Cesium.Ray(startPosition, Cesium.Matrix3.getColumn(direction, 2));

// Get the intersection point with the ground
var intersection = Cesium.IntersectionTests.grazingAltitudeLocation(ray, Cesium.Ellipsoid.WGS84);

// If there is an intersection with the ground
if (intersection) {
var intersectionPosition = Cesium.Cartographic.toCartesian(intersection);
var groundLatLng = Cesium.Cartographic.fromCartesian(intersectionPosition);
var groundLat = Cesium.Math.toDegrees(groundLatLng.latitude);
var groundLng = Cesium.Math.toDegrees(groundLatLng.longitude);
var groundAlt = groundLatLng.height;

console.log(“Ground intersection point:”);
console.log("Latitude: " + groundLat);
console.log("Longitude: " + groundLng);
console.log("Altitude: " + groundAlt);
} else {
console.log(“No intersection with the ground!”);

The ray points to the sky, so there is no intersection with the ground