If you find yourself suddenly using the Eraser instead of the Pen or Highlighter tool, chances are you've accidentally triggered the double-tap gesture of the Apple Pencil.
Please try turning it off.
If the issue persists even with that system-wide feature disabled, please help us investigate this by sending over the Diagnostic Data, especially as soon as the issue has occurred. Please open GoodNotes ⚙️ menu in the library view > About > Export Diagnostic Data.
Please also record the issue with your smartphone showing how you typically write when this issue occurs and send us the recording as well.