"There was a problem compiling the code from your notebook."

Well where is the hist variable defined? If it did not throw that error when you run the tests locally, then the most likely theory is that there is something about your code that is not “general”: it works differently when the grader calls your functions with different test cases.

So the next step is to carefully consider the logic that defines hist: is there anything about that which depends on the state of other variables in the notebook that might be different in the grader test cases?

Or maybe you modified some other parts of the notebook not do with the code you need to write in order to get it to work on your local machine. You might want to get a clean copy of the assignment and very carefully copy over just your solution code from the “YOUR CODE HERE” segments.