"Up the creek" is a shortened version of "to be up the creek without a paddle", which basically means to be in a difficult or troubling situation. Picture the speaker in a canoe on a river with no way to maneuver. Another (profane) way this phrase is often altered is "to be up s**t creek".
I wouldn't say that either of your uses is wrong, but I wouldn't typically employ the phrase as a
(teacher to student) You forgot your homework again. If you forget it again, you will be up a creek. (A to coworker) I couldn't finish the project. I am up a creek. And my teammates are up a creek too.