Getting information from entity given by raycast

@sim @John the hit entity returned by the raycast does not seem to give access to new variables i have added to the entity? here is a small program that illustrates this:

-- testRaycast

function setup()
    
    scene=craft.scene()
    
    myent=scene:entity()
    myent.model = craft.model.icosphere(5)
    myent.position=vec3(50,0,0)
    
    rb=myent:add(craft.rigidbody, STATIC)
    myent:add(craft.shape.model, myent.model)
    
    myent.addedParam="hello"
    
    parameter.watch("myent.addedParam")
    parameter.watch("ta.point")
    parameter.watch("ta.entity")
    parameter.watch("ta.entity.position")
    parameter.watch("ta.entity.addedParam")
end

function update(dt)
    ta=scene.physics:raycast(vec3(0,0,0), vec3(1,0,0), 100) 
end

function draw()
    update(DeltaTime)
    scene:draw()
end

Is it allowed to add variables to the ‘entity’? Usually it seems to work.
If so, why doesn’t the raycast entity give me access to my added variables?