https://discourse.gnome.org/t/how-to-add-st-scrollview-to-gnome-shell-extension/15901/10?u=ga_karam
The add_actor() method of Clutter.Actor class worked instead of add_child() method. So, I think the error I was getting was because of the GNOME-Shell version I am using.
I am using GNOME Shell 42.9.
Thank you.