Charts SectorMark causing app to crash

Anytime I have 1 item, then add another, the app crashes with the following error:

Swift/IntegerTypes.swift:8835: Fatal error: Double value cannot be converted to Int because it is either infinite or NaN

I'm not working with Int values though, so I'm not sure why this is happening. It's also not point me towards any specific line. I've printed out all of the values being used for the chart and none of them are showing as infinite or NaN.

The data being used is created in a View.

@State private var pieChartData: [PieChartDataPoint] = []

Then in the onAppear and onChange its gets loaded using the following function:

func getPieChartDataPoints() -> [PieChartDataPoint] {
        self.map({ PieChartDataPoint(label: $0.name, value: $0.monthlyAmount()) })
    }

That's an extension on a SwiftData model type I have called Recurring.

@Model
final class Recurring {
    var id = UUID()
    
    enum Kind: String, CaseIterable, Codable {
        case income = "Income"
        case bill = "Bill"
        
        func plural() -> String {
            switch self {
            case .income:
                "Income"
            case .bill:
                "Bills"
            }
        }
    }
    
    enum Frequency: String, CaseIterable, Codable, Identifiable {
        var id: Frequency { self }
        case weekly = "Weekly"
        case biweekly = "Biweekly"
        case monthly = "Monthly"
        case quarterly = "Quarterly"
        case annually = "Annually"
    }
    
    var name: String = ""
    var kind: Kind = Kind.income
    var frequency: Frequency = Frequency.biweekly
    var amount: Double = 0
    
    init(name: String, kind: Kind, frequency: Frequency, amount: Double) {
        self.name = name
        self.kind = kind
        self.frequency = frequency
        self.amount = amount
    }
    
    func amount(from cycle: Cycle) -> Double {
        switch cycle {
        case .weekly:
            monthlyAmount() * 12 / 52
        case .biweekly:
            monthlyAmount() * 12 / 26
        case .monthly:
            monthlyAmount()
        }
    }
    
    func monthlyAmount() -> Double {
        switch frequency {
        case .weekly:
            amount * 52 / 12
        case .biweekly:
            amount * 26 / 12
        case .monthly:
            amount
        case .quarterly:
            amount * 4 / 12
        case .annually:
            amount / 12
        }
    }
}

Here is the DataPoint structure.

struct PieChartDataPoint: Identifiable, Equatable {
    var id = UUID()
    
    var label: String
    var value: Double
}

Finally here is the chart.

Chart(sorted, content: { dataPoint in
                                
                SectorMark(
                    angle: .value(dataPoint.label, getValue(from: dataPoint)),
                    innerRadius: 50,
                    angularInset: 5
                )
                .foregroundStyle(by: .value("Label", dataPoint.label))
                .cornerRadius(10)
                .opacity(getSectorMarkOpacity(for: dataPoint))
                 
            })
            .scaledToFill()
            .chartLegend(.hidden)
            .chartAngleSelection(value: $chartSelection)
            .onChange(of: chartSelection, checkSelection)

For testing purposes, I have removed all of the modifiers and only had a simple SectorMark in the Chart, however, that was still crashing.

Does anyone know why this is happening?

The console was printing the following:

Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 

If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.

I did that and received the following:

Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.

Backtrace:
  <CGPathAddLineToPoint+80>
   <+[UIBezierPath _continuousRoundedRectBezierPath:withRoundedCorners:cornerRadii:segments:smoothPillShapes:clampCornerRadii:]
    <+[UIBezierPath _continuousRoundedRectBezierPath:withRoundedCorners:cornerRadius:segments:]+184>
     <+[UIBezierPath _roundedRectBezierPath:withRoundedCorners:cornerRadius:segments:legacyCorners:]+340>
      <-[_UITextMagnifiedLoupeView layoutSubviews]+1256>
       <-[UIView(CALayerDelegate) layoutSublayersOfLayer:]+2420>
        <_ZN2CA5Layer16layout_if_neededEPNS_11TransactionE+424>
         <_ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE+132>
          <_ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd+484>
           <_ZN2CA11Transaction6commitEv+636>
            <_ZN2CA11Transaction25flush_as_runloop_observerEb+68>
             <_UIApplicationFlushCATransaction+48>
              <__setupUpdateSequence_block_invoke_2+356>
               <_UIUpdateSequenceRun+76>
                <schedulerStepScheduledMainSection+204>
                 <runloopSourceCallback+80>
                  <__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+24>
                   <__CFRunLoopDoSource0+168>
                    <__CFRunLoopDoSources0+220>
                     <__CFRunLoopRun+780>
                      <CFRunLoopRunSpecific+536>
                       <GSEventRunModal+164>
                        <-[UIApplication _run]+796>
                         <UIApplicationMain+124>
                          <$s7SwiftUI17KitRendererCommon33_ACC2C5639A7D76F611E170E831FCA491LLys5NeverOyXlXpFAESpySpys4Int8VGSgG
                           <$s7SwiftUI6runAppys5NeverOxAA0D0RzlF+180>
                            <$s7SwiftUI3AppPAAE4mainyyFZ+148>
                             <$s4Takt0A3AppV5$mainyyFZ+40>
                              <__debug_main_executable_dylib_entry_point+12>
                               104fd93d4                                10516c924

I also confirmed that it's only occurring on SectorMark and this is in an iOS 18.5 sim.

Charts SectorMark causing app to crash
 
 
Q