Per the Sporting Code, a driver may withdraw from a race at any time prior to two minutes before the race session start with no penalty. Should a driver forfeit, said driver is scored in last place for the race and receives 0 points towards his/her race week. Also, his/her iRating will reflect a change associated with a last place finish.
https://ir-core-sites.iracing.com/members/pdfs/20210831-iRacing-Sporting-Code_dated_Aug_30_2021.pdf