Rviz runs fast and reports errors fast. Sometimes, it reports errors just because other nodes have not been ready and associated messages have not been published. It is annoying.
Since Lifecycle can manage the bringup and shutdown of the different nodes involved in the robot’s operation, is it possible to use it to manage Rviz2?
Can this be done in ‘nav2_map_server_launch.py?’
Can we use the lifecycle to delay the execution of Rviz2?
Rviz2 is not a managed node, just a regular one. As a consequence you cannot manage the state of Rviz2 using lifecycle management.
However Riv2 is just a graphical interface to visualize information. If that information is not available yet the Rviz2 display should just show nothing maybe just the error message that you mention. Once the information is available Rviz should recognize that, display it and the error message should disapear.