Is this a bug: Declared default for optional argument ignored

When I declare a default value for an Optional argument, but specify a later argument by name, the previous argument does not receive the specified default value. It looks as though it receives instead the default value for variables of the specified type.

Is this behaviour intentional? documented? To me personally it seems to be in obvious conflict with this statement in the help:

= expression: Specify a default value for the argument, matching its declared type. Optional is necessary for each argument specifying a default value.

It seems pretty embarrassing, as fixing this could break existing macros, but it has tripped me up many a time already. I could not find it in Bugzilla, searching LibreOffice/BASIC for “default optional argument”. At a minimum, if it cannot be fixed cleanly, the Help quoted above should accurately describe the actual behaviour.

In the following code, the first argument receives the value False although the default was declared to be True:

REM  *****  BASIC  *****

Option Explicit

Option Compatible

' Demonstrate a bug in assigning values to optional parameters:
'	When an optional parameter is specified by name,
'	preceding unspecified optional parameters do not honour default values specified in the declaration.
Sub Bug_Optional_Default_Ignored ()
	Bug_Optional_Default_Ignored_Sub	(Y_B := True)
End Sub

' Demonstrate a bug in assigning values to optional parameters, as above
Sub Bug_Optional_Default_Ignored_Sub	( Optional	y_A		as Boolean	= True	_
										, Optional	y_B		as Boolean	= False	_
										)
	MsgBox ("A = " + y_A + ",  B = " + y_B)
End Sub

I believe I have seen this in a number of versions, but currently I am seeing it in this:
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded

This is a bug in the (poorly supported) by-name argument passing.

Reported a bug at 159455 – Declared default for optional argument ignored when later argument specified by name.

I have just realised that I have been seeing another aspect of this problem: when an argument is passed by name, IsMissing for a preceding Optional parameter returns False although it is not supplied.
It is possible to make IsMissing return True by “explicitly omitting” the parameter, i.e. writing “,” in the appropriate place.

I suspect this is all a result of the same mechanism, so that this may be regarded as another aspect of the same bug, and I have added a comment describing this to bug 159455
Again, correcting this behaviour could break existing code.

This is demonstrated by the following test, in which the 3rd and 4th calls display the wrong behaviour.

Sub Bug_Optional_Not_IsMissing_2 ()
	Bug_Optional_Not_IsMissing_2_Sub	()
	Bug_Optional_Not_IsMissing_2_Sub	(,)
	Bug_Optional_Not_IsMissing_2_Sub	(B := True)
	Bug_Optional_Not_IsMissing_2_Sub	(B := False)
	Bug_Optional_Not_IsMissing_2_Sub	(, B := True)
	Bug_Optional_Not_IsMissing_2_Sub	(, B := False)
End Sub

' Demonstrate a bug in IsMissing for optional parameters, as above
Sub Bug_Optional_Not_IsMissing_2_Sub _
( Optional A as Boolean _
, Optional B as Boolean = False _
)
	MsgBox ("IsMissing (A) = " + IsMissing (A) + ",  B = " + B)
End Sub