A discussion of the opposite play (a kick attempted from the run/pass starting position) on footballzebras.com notes that the rulebook does not specify this, but declares that this would be legal and still valid for 2 points.
If a team attempts a kick that does not snap from the 15 (or equivalent yard line after a penalty), it is a touchback, and the conversion attempt fails.
On the other hand, if the line of scrimmage is set for a kick, the offense may still run or pass for two points, particularly if there is a botched snap.
This agrees with my personal opinion of what should happen on the field.
Per ESPN, on October 1, 2023, Dallas became the first team to score 2 points on a fake field goal try since the attempts were relocated. (They do point out that the Browns scored 2 on a blocked attempt in 2019).
This happened during the 2023 week 4 matchup between the Patriots and Cowboys. After a Cowboys touchdown early in the 2nd quarter, Dallas lined up for a try in the field goal formation from the 15. Instead of a kick, the team threw a forward pass and was able to move the ball into the end zone. The successful try was awarded two points.
NFL video on youtube.