This example works:
@startuml
!function $inner($param1, $param2 = "arg2")
!return $param1 + " " + $param2
!endfunction
!function $test($param)
!return $param
!endfunction
A -> B: $test($inner("arg1", "newarg2"))
@enduml
But if we will try to call $inner with one argument as param of $test function, there is an exception "Bad number of arguments in $inner". It means that default value inside functions doesn't work. Try this to see exception:
@startuml
!function $inner($param1, $param2 = "arg2")
!return $param1 + " " + $param2
!endfunction
!function $test($param)
!return $param
!endfunction
A -> B: $test($inner("arg1"))
@enduml