Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'access' at row 1:
XmlSitemapLinkStorage::create()
When access is not granted (example: user profile view for Anonymous user), the xmlsitemap access is not checked correctly for integer values and entity save will crash.
Also I removed the unnecessary variables $url and $uri
The integer problem is with "status" to, in some cases. So I moved to must check section of the code.
Example: Check user entity at settings and save (but not configure), in this case the user entity is "Excluded" by default and the status is blank. So when type is Excluded status is NULL and save will crash.
patch attached for fix