Occasionally, an inspector may find other issues when visiting your home that require attention. This is most common when improvements have been done in the past without proper inspections or permits. Depending on the type of issue, inspectors can sometimes require that other additional repairs be made before allowing the current job to pass inspection.
This can be frustrating as it may require additional work on your home and can delay current work being done. Inspectors are most likely to make this decision when the previous work is wildly outside of code or represents a safety hazard in your home. It doesn't happen very often but can become an unexpected issue that must be dealt with.
The best way to prevent this is to ensure that all work done to your home is properly permitted and inspected.