My code is fine, it is your code that is wrong.
On your picture above you are using a user input box which has the element id of #input1

As you are using a user input element, then you need to be using it as this.
$w('#input1').value = results.items[0].firstName;
let toInsert = {
firstName: $w("#input1").value
If you want to use a text box element with the element id name of #text22 instead of a user input element, then you will need to change it to suit.
$w('#text22').text = results.items[0].firstName;
let toInsert = {
firstName: $w("#text22").text