The problem is that you are just doing the reshape directly to the desired final shape. That does not work, because it scrambles the data. You need to do it in two steps: first a reshape, then a transpose. They discuss this in the instructions, but perhaps they are not as explicit about it as they should be. The reason for the scrambling is the same as the reason we needed a transpose when we “flattened” our images in Course 1 Week 2. Here’s a thread which discusses that and demonstrates why the transpose is required.
Update: here’s a more recent thread that shows a very specific example for the given case here of the right and wrong ways to do the reshaping.