that’s a little fragile, despite it actually working.
You should maybe keep a reference to the form in Form1. For example :
self.my_new_form = Form2()
self.content_panel.add_component(self.my_new_form)
then you could do this from anywhere :
get_open_form().my_new_form.my_function()