Ampere's Law is always valid (ignoring displacement current for now). However, you can only use it to determine the field of a configuration when certain symmetries are present. This is why you only see it used on
- Cylinders (Like straight wires)
- Planes (Current sheets)
- Straight solenoids
- Torroidal solenoids
The reason we can only use Amepere's law to determine the field in these specific systems is because we can make symmetry arguments that allows us to move the field term $B$ out of the line integral.
The problem with your drawing of an Amperian loop that is concentric with a section of the current loop is that the field is not behaving in a nice way around your Amperian loop. It changes magnitude as well as direction relative to the loop. Compare this to the torroidal solenoid where we can argue that the field has a constant magnitude and always points in the same direction of our Amperian loop as we move around the loop. In your wire case, there would be no way to take the $B$ term out of your line integral then. Ampere's law cannot be used to determine the field along your Amerpian loop here.