is there a possibility to record audio from the internal phone microphone when a headset is plugged in?
You could specify VOICE_COMMUNICATION as the audio source for your recording. Keep in mind though that this will most likely enable the internal microphone tuned for near-field use-cases (e.g. when you hold the phone next to your ear) rather than far-field use-cases (where you record audio from a few feet away).