Three mistakes I see:
Using DFS for shortest path (works for "any path", not "shortest path")
Forgetting parent tracking in undirected cycle detection (you will count edges as cycles)
Using BFS for longest path (BFS minimizes distance, DP maximizes it in DAGs)
Another common error: not reconstructing the path when the problem asks for it. Always keep a parent or predecessor array during BFS or DP if you need to output the actual path, not just the distance or length.