It's legal.
I saw nothing in your post that raised a suspicion that you would bill anybody for hours you didn't work so I don't know where the other responses came from.
But, to be on the safe side, make sure your agreements include billing by the job and not by the hour.
They can find out any number of ways that no one can predict.
Any one or more of your employers (or clients) might not like it and terminate you for it. And that would be legal, too.

