There appears to be a bug in map-fixed-layout.tsx, part of the map widget. Line 72 doesn't include a check to confirm whether the ui property is null or not. When programmatically changing away from and then back to a datasource the widget will crash.
Updating the line to read
this.props.jimuMapView && this.props.jimuMapView.view && this.props.jimuMapView.view.ui && this.insertFixedDom(this.props.jimuMapView.view.ui.container, this.fixedLayoutRef)
will fix the issue.