Your addRecordToUserWishlist function is updating your db correctly, but your UI state isn't properly showing the changes because---->
You are modifying the original record object directly (record.IsInWishlist = !record.IsInWishlist)
Your UI state still referencing recordsInDatabase (the original Flow), not the newly updated data
This is what i understand in a quick look