A script raycasts from camera at mouse position
The target has a collider, a script which hit.transform.GetComponent(script) should detect but it doesn’t!
The doc says RaycastHit.transform returns the transform of the collilder OR the rigidbody the ray hit.
So if script is on the collider, that collilder doesn’t have rb but is parented to a rb which has no script, hit.transform.GetComponent(script) SHOULD return true.
So is this a know bug? is there a workaround?
Try this:
hit.transform.gameObject.GetComponent(scriptName).*
A collider is a component of a game object as well as it is a script, I guess what you want is to access the script that is attached to same gameobject that the collider the raycast hits is.
Actually I found the way to detect the script:
hit.collider.GetComponent(script)
So the doc is wrong - transform refers to the transform attached to the rb… can’t wait for 2.1 
If this is indeed a bug then make a simple project illustrating it and file a bug report. Perhaps it’ll make its way into 2.1 
It’s not a bug, just inaccurate doc.
bug report it as a doc fix.