You say the themes were installed correctly and you could switch between them and the error occurred when you were 'working with themes' - although you don't say exactly what you were doing, so:
Roll back the changes you made to whichever theme you were working on at the time, clear all caches and start again from the default themes, or the fresh downloaded themes.
If you need to, actually delete the folder of the theme you were working on, or replace it with a fresh download of that theme
Test your changes as you go - and enable debugging mode (Site Admin > Development) so you can get reports from Moodle of what might be the problem.