Shahada While Terminally Ill
According to Ghamidi Sahab, the door to repentance and forgiveness is open till the time one sees the death happening to them or sees the angel of death, like Pharoah when started to drown and professed faith, such a faith is not acceptable. This does not apply to you. You need to have faith in God and should not let baseless doubts bother you in this regard. Professing faith while being alive is not a punishment but a blessing. Sharing comments of Ghamidi Sahab as stated above for reference: Please refer to the link below from 25:44 to to 29:09 (Specifically from 27:00 to 27:27 ) https://www.youtube.com/live/CEQzK6LBNaU?si=xaQlwFN-V4ly3fX4&t=1544
Unacceptable repentance near death is about the cases in which man keeps avoiding a sin or truth which has already realized to be true. Yours coming to faith is not our of fear but a conscious decision. This is a different case. When something believable to you, you accepted it, no matter death is approaching or not. Nor is it near death experience as clarified by Umer Qureshi saheb. God is just and merciful. He is not interested in punishing people, unless they become rebels.