Tested under macOS Big Sur and macOS Catalina using English (US) as the language, the following example AppleScript code works to programmatically add another Desktop:
do shell script "open -a 'Mission Control'"
delay 0.5
tell application "System Events" to ¬
click (every button whose value of ¬
attribute "AXDescription" is "add desktop") of ¬
group 2 of group 1 of group 1 of process "Dock"
delay 0.5
tell application "System Events" to key code 53
Note that most likely works from macOS Sierra onwards. Prior to that, remove group 2 of group 1 of
from the code.
For other languages, including English, try the following example AppleScript code:
do shell script "open -b 'com.apple.exposelauncher'"
delay 0.5
tell application id "com.apple.systemevents"
tell (every application process ¬
whose bundle identifier = "com.apple.dock") to ¬
click (button 1 of group 2 of group 1 of group 1)
delay 0.5
key code 53 -- esc key
end tell