Hello,
Welcome to Microsft Q&A!
This is the expected behavior. The broadFileSystemAccess capability only works for Windows.Storage APIs. This is mentioned in the document-Restricted capabilities. That's why you will get the exception when you trying to call the writexaml method. If you are not using Windows.Storage APIs, please still put the target file to the places that UWP apps have default permission.
Thank you.