Yes, you always need to be careful that you provide the correct shape of the input. LSTM is fine with both (2,5,100) and (5,2,100) since the difference is not on a technical level but depends on your context.
As a side node, this is why the view() command is dangerous. Just because the shape is correct (e.g., a subsequent layer doesn’t complain about the shape) after applying view() does not mean that from a semantic point of view the reshaping was done correctly.