I gave my employer 12 weeks notice (instead of the normal notice they request of 2 weeks). However, I am not doing much and want to leave before the 12 weeks is over.
Am I at risk for any penalty?
This is company specific.
If you wish to terminate your employment before your notice is up, talk to HR and see what you can work out with them. Leaving early without doing so can burn the bridge and prevent you from coming back to this company if you ever need to. Additionally, even though most jurisdictions forbid it, hiring managers talk, and you may find it harder to find a job in the future if you get a reputation for not serving your notice period.
In the future, I would recommend not giving more than the required notice, barring special relationships with your boss or other similar circumstances.
Note: In general, if you served a long notice, and the company kept you on (as opposed to informing you that the notice period is not required and letting you go immediately) It means they expect that they will need you during that notice period. If you're lacking things to do, discuss that with your manager.
If two weeks notice is required, then you can give two weeks notice at any time. For example after nine weeks of your original notice.