Thanks for your replies, my fault I didn't explain the issue properly.
I have been using Node-Red for a couple of years now, so I know how to obtain the path and data of any messages and have built some fairly complex projects.
What was puzzling me was that if I simply write the following in a function node I got an error, without running it.
var x = msg.payload.illumination.phase.from
var y = msg.payload.illumination.phase.to
So it really doesn't matter what the payload is as I never had the opportunity to run it.
I asked the question as I couldn't see any particular reason why this should be a problem. Since then I have rebooted Node-Red and the issue has gone away and I can now write this into the function. It seems Node-Red itself had some issue and perhaps I should have rebooted it in the first place before asking the question.
Just for reference the Moon Node has the following output of the complete msg object, showing the only msg outside of the payload is the lat, lon and topic.
{"_msgid":"a066365ad9562745","lat":51.509865,"lon":-0.118092,"payload":{"ts":1716539734000,"lastUpdate":"2024-05-24T08:35:34.000Z","lastUpdateStr":"2024-05-24T09:35:34","latitude":51.509865,"longitude":-0.118092,"angleType":"deg","azimuth":275.8934816671064,"altitude":-39.24643914147571,"altitudeDegrees":-39.24643914147571,"azimuthDegrees":275.8934816671064,"altitudeRadians":-0.6849795827023278,"azimuthRadians":4.815249639881621,"distance":387839.64345437713,"parallacticAngle":43.92348800383688,"illumination":{"fraction":0.9927357733030052,"phase":{"from":0.466136806691289,"to":0.533863193308711,"id":"fullMoon","emoji":"🌝","code":":full_moon_with_face:","name":"Full Moon","weight":1,"css":"wi-moon-full"},"phaseValue":0.5271626432772403,"angle":2.1990735294888193,"next":{"value":1717076698261.5,"date":"2024-05-30T13:44:58.261Z","type":"thirdQuarter","newMoon":{"value":1717714558956,"date":"2024-06-06T22:55:58.956Z"},"fullMoon":{"value":1718990280345,"date":"2024-06-21T17:18:00.345Z"},"firstQuarter":{"value":1718352419650.5,"date":"2024-06-14T08:06:59.650Z"},"thirdQuarter":{"value":1717076698261.5,"date":"2024-05-30T13:44:58.261Z"}}},"zenithAngle":82.07414407481025,"times":{"rise":"2024-05-24T21:45:16.450Z","set":"2024-05-24T03:49:56.069Z","alwaysUp":false,"alwaysDown":false,"highest":"2024-05-24T12:47:36.259Z"},"positionAtRise":{"azimuth":2.4110902793848616,"altitude":0.0037763630712496594,"azimuthDegrees":138.1452970337711,"altitudeDegrees":0.21636966589166687,"distance":385234.2249828217,"parallacticAngle":-0.48894960950229566,"parallacticAngleDegrees":-28.014749019051234},"positionAtSet":{"azimuth":3.928591365849633,"altitude":0.0030079180325627885,"azimuthDegrees":225.0917046947195,"altitudeDegrees":0.1723410083871419,"distance":388773.20643887366,"parallacticAngle":0.5142043676908113,"parallacticAngleDegrees":29.461740075876637},"highestPosition":{"azimuth":0.06278820271705365,"altitude":-1.1374260162897294,"azimuthDegrees":3.597499018899023,"altitudeDegrees":-65.16971024177992,"distance":387010.99659302,"parallacticAngle":-0.043920524934587556,"parallacticAngleDegrees":-2.516460712750963},"altitudePercent":60.22190216263237,"isUp":false,"pos":[],"posChanged":false},"topic":"moon"}