Here is a piece of code doing the trick.
It appears that trying to click the button defined by its index is a bad idea.
Defining it by its name works well.
#=====
my Rechercher_Remplacer("lapin", "la" & linefeed & "pin")
#=====
on Rechercher_Remplacer(avant, |après|)
tell application "Numbers" to activate
tell application "System Events" to tell application process "Numbers"
keystroke "f" using {command down}
title of window 1
--> "Rechercher et remplacer"
tell window result
set value of first text field to avant
set value of second text field to |après|
title of button -3 # To get the button's name
--> "Tout remplacer"
click button result
end tell
keystroke "w" using {command down} # Close the dialog
end tell -- System Events…
return
end Rechercher_Remplacer
#=====